PHPCSStandards / PHP_CodeSniffer

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
BSD 3-Clause "New" or "Revised" License
856 stars 53 forks source link

Generic/DisallowYodaConditions: `??` should not trigger the sniff #458

Closed rodrigoprimo closed 4 months ago

rodrigoprimo commented 4 months ago

Description

This PR changes the Generic.ControlStructures.DisallowYodaConditions sniff so that the null coalescing operator (??) does not trigger it.

Suggested changelog entry

Generic.ControlStructures.DisallowYodaConditions: null coalescing operator (??) should not trigger the sniff

Types of changes

PR checklist