PHP_CodeSniffer icon indicating copy to clipboard operation
PHP_CodeSniffer copied to clipboard

4.0 | Make isset, unset and empty parenthesis owners

Open jrfnl opened this issue 1 year ago • 0 comments

Repost from https://github.com/squizlabs/PHP_CodeSniffer/issues/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.


See the original post for some pointers about the implementation.

jrfnl avatar Nov 08 '23 09:11 jrfnl