Skip to content

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented Oct 14, 2025

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
Copy link
Member Author

jrfnl commented Nov 11, 2025

Rebased without changes to run CI based on current version of the GHA scripts/PHPCS rules.

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 jrfnl force-pushed the feature/new-universal-requireexitdieparentheses-sniff branch from 1bbe02d to 6638489 Compare November 11, 2025 00:57
@jrfnl jrfnl merged commit 108e829 into develop Nov 11, 2025
80 checks passed
@jrfnl jrfnl deleted the feature/new-universal-requireexitdieparentheses-sniff branch November 11, 2025 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants