You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Suggestion: make isset, unset and empty parenthesis owners #3118
I was just wondering why isset(), unset() and empty() - all language constructs which require parentheses - are not considered parentheses owners.
Would it make sense to change that ? Should be a relatively easy change to make as far as I can see.
Happy to make the changes if there is interest.
[Edit]: Might be useful to include exit(), die() and eval() as well, though these three don't require parentheses, but are "owners" when the parentheses are present.
Makes sense to me. For the constructs that don't require parenthesis, just need to make sure they don't go hunting for unowned ones and claiming them, although this may already be protected against.
For the constructs that don't require parenthesis, just need to make sure they don't go hunting for unowned ones and claiming them, although this may already be protected against.
Eh.. not really... that's part of the problem with closure T_USE as parenthesis owner for which PR #3104 is open.....
With that in mind, should this be addressed in PHPCS 3.x or 4.x ? (PR #3104 is for 4.x and includes part of the protection which would need to be added for the above as well.)
Activity
Parentheses: recognize more parentheses owners
gsherwood commentedon Sep 21, 2020
Makes sense to me. For the constructs that don't require parenthesis, just need to make sure they don't go hunting for unowned ones and claiming them, although this may already be protected against.
jrfnl commentedon Sep 22, 2020
Eh.. not really... that's part of the problem with closure
T_USEas parenthesis owner for which PR #3104 is open.....With that in mind, should this be addressed in PHPCS 3.x or 4.x ? (PR #3104 is for 4.x and includes part of the protection which would need to be added for the above as well.)
jrfnl commentedon Dec 2, 2023
Closing as replaced by PHPCSStandards/PHP_CodeSniffer#23