PHPCSExtra icon indicating copy to clipboard operation
PHPCSExtra copied to clipboard

:sparkles: New `Universal.PHP.RequireExitDieParentheses` sniff

Open jrfnl opened this issue 3 months ago • 0 comments

This sniff checks that calls to exit/die use parentheses, even if no argument is given and can be used to address the following rule from PER-CS:

4.7 Method and Function Calls ... The exit() and die() functions SHOULD always be called with parentheses even if no argument is given to clearly distinguish them from an access to a constant named exit or die.

Ref: https://www.php-fig.org/per/coding-style/#47-method-and-function-calls

Includes fixer. Includes unit tests. Includes documentation.

jrfnl avatar Oct 14 '25 03:10 jrfnl