Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QA: remove unreachable code #96

Merged
merged 3 commits into from
Dec 4, 2023
Merged

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Nov 11, 2023

Description

Recreation of upstream PR squizlabs/PHP_CodeSniffer#3912:

Tests: remove unreachable code

break after a return statement is redundant.

As a side-note: I did have to chuckle when I saw that the NonExecutableCode test file also included this 😂

Various: remove some redundant return statements

... when the return is at the end of the function without a value, and therefore not needed.

PHPCS: add the Squiz.PHP.NonExecutableCode sniff to the ruleset

... which is used for PHPCS itself.

Suggested changelog entry

N/A

jrfnl added 3 commits December 4, 2023 16:35
`break` after a `return` statement is redundant.

As a side-note: I did have to chuckle when I saw that the `NonExecutableCode` test file also included this 😂
... when the `return` is at the end of the function without a value, and therefore not needed.
@jrfnl jrfnl force-pushed the feature/qa-remove-unreachable-code branch from fb5986a to 2f77a2a Compare December 4, 2023 15:37
@jrfnl jrfnl merged commit 931f475 into master Dec 4, 2023
63 checks passed
@jrfnl jrfnl deleted the feature/qa-remove-unreachable-code branch December 4, 2023 15:43
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.

1 participant