phpcq / coding-standard

This repository holds the C-C-A coding standard definitions for phpcs and phpmd.
BSD 3-Clause "New" or "Revised" License
1 stars 2 forks source link

Null coalescing operator detected as arithmetic operation #7

Open dmolineus opened 5 years ago

dmolineus commented 5 years ago

I'm not sure if it's an issue of phpcq or the php code sniffer. I often run into the issue that the null coalescing operator ?? is detected as arithmetic operation and so the usage of brackets are forced.

The ternary operator ?: instead isn't detected as arithmetic operation.

discordier commented 5 years ago

This seems to be an issue in phpcs itself. The coresponding sniff is not changed by us.

dmolineus commented 5 years ago

I opened an issue (https://github.com/squizlabs/PHP_CodeSniffer/issues/2325) for it.