- Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
PHP_CodeSniffer_File::findEndOfStatement sometimes returns end token, but sometimes it returns the last not empty token before that.
E.g. if $start
is new
:
- in
[new Datetime]
it returns]
. - in
array(new Datetime)
it returnsDatetime
. - in
new Datetime;
it returns;
.
The difference between array()
and []
is probably a mistake, because []
was added later in 4df216f, but I don't understand why there's a difference at all.
The examples above are from a sniff that adds ()
to new
. If findEndOfStatement consistently returned the last non-empty statement (like it does for array(new Datetime)
), I could insert the ()
after that.