Raise Squiz.PHP.NonExecutableCode to error by gmponos · Pull Request #204 · doctrine/coding-standard · GitHub
Skip to content

Raise Squiz.PHP.NonExecutableCode to error#204

Open
gmponos wants to merge 1 commit into
doctrine:8.2.xfrom
gmponos:patch-4
Open

Raise Squiz.PHP.NonExecutableCode to error#204
gmponos wants to merge 1 commit into
doctrine:8.2.xfrom
gmponos:patch-4

Conversation

@gmponos

@gmponos gmponos commented Jun 19, 2020

Copy link
Copy Markdown
Contributor

Not sure if this was on purpose.

This rules is intent to throw a warning and not an error.

@gmponos gmponos requested a review from a team as a code owner June 19, 2020 09:50
@greg0ire

Copy link
Copy Markdown
Member

@gmponos

gmponos commented Jun 19, 2020

Copy link
Copy Markdown
Contributor Author

No no... I think the intent of Squiz.PHP.NonExecutableCode is what it is..

Not sure if doctrine org intentions was to have it as a warning or if you just missed that.. If this rule is added to doctrine standard as a warning on purpose then we can close this..

@SenseException

Copy link
Copy Markdown
Member

I don't know if this was intended to be a warning, but I like to have an error here for NonExecutableCode. It had a few false positives in the past and maybe that's why it's a warning, but if this isn't an issue anymore, then an error would be fine.

@greg0ire greg0ire changed the base branch from master to 8.2.x October 25, 2020 10:06
@greg0ire greg0ire requested a review from a team April 3, 2021 11:14
@greg0ire

greg0ire commented Apr 3, 2021

Copy link
Copy Markdown
Member

Not sure about the target branch… is this really a bugfix?

@Ocramius Ocramius left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO requires major anyway, still LGTM

@derrabus

Copy link
Copy Markdown
Member

Maybe we should consider removing the rule completely. It produces false positives for throw expressions in PHP 8 and PHPStan/Psalm should have a better dead code detection.

see squizlabs/PHP_CodeSniffer#2857

@Ocramius

Copy link
Copy Markdown
Member

Works too 👍

@jrfnl

jrfnl commented May 4, 2023

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants