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

Allow specifying errorIdentifier to RuleError #97

Merged
merged 1 commit into from
Dec 30, 2021

Conversation

ruudk
Copy link
Contributor

@ruudk ruudk commented Dec 12, 2021

Ultimately every error in PHPStan should have its own unique identifier so that its
possible to group by error type and ignore errors based on identifier.

phpstan/phpstan#1686 (comment)
phpstan/phpstan#3065

@spaze
Copy link
Owner

spaze commented Dec 12, 2021

Oh nice, thanks! I always wanted to start using RuleErrorBuilder but never got around to it. I'll check the whole PR later.

Copy link
Owner

@spaze spaze left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Some smaller things I'd like (youl to address 😀 I've also merged the previous PR so you can rebase this one.

src/DisallowedCall.php Outdated Show resolved Hide resolved
src/DisallowedCall.php Outdated Show resolved Hide resolved
src/DisallowedConstant.php Outdated Show resolved Hide resolved
src/DisallowedNamespace.php Outdated Show resolved Hide resolved
phpstan.neon Outdated Show resolved Hide resolved
@ruudk ruudk force-pushed the identifier branch 3 times, most recently from e89bf51 to 35af166 Compare December 13, 2021 19:08
@ruudk
Copy link
Contributor Author

ruudk commented Dec 13, 2021

@spaze I have no idea how to solve the phpcs issues. They conflict with each other. If I run composer run cs-fix it cannot fix it. What to do?

@spaze
Copy link
Owner

spaze commented Dec 14, 2021

@spaze I have no idea how to solve the phpcs issues. They conflict with each other. If I run composer run cs-fix it cannot fix it. What to do?

Oh what a mess! :-D Couldn't hit the problem first but then I ran composer update and voila, shit. Seems that a new code sniffer version released just yesterday "Added new PSR12.Classes.OpeningBraceSpace sniff to enforce this" (squizlabs/PHP_CodeSniffer#3437).

I'll update the coding style to remove the new requirement. Sorry for the trouble and thanks for hitting it before I do :-)

Ultimately every error in PHPStan should have its own unique identifier so that its
possible to group by error type and ignore errors based on identifier.

phpstan/phpstan#1686 (comment)
phpstan/phpstan#3065
@spaze
Copy link
Owner

spaze commented Dec 14, 2021

@ruudk all green now again :-) As an extra I've also added PHP 8.1 tests and rebased this branch. Let me know once the PR is ready, I'll re-review or something. Currently sort of busy so please allow a day or 2 (or 5). Thanks!

@spaze spaze changed the title Allow specifying identifier to RuleError Allow specifying errorIdentifier to RuleError Dec 14, 2021
@spaze spaze merged commit dd58d51 into spaze:master Dec 30, 2021
@ruudk ruudk deleted the identifier branch December 30, 2021 06:53
spaze added a commit that referenced this pull request May 14, 2024
https://phpstan.org/blog/phpstan-1-11-errors-identifiers-phpstan-pro-reboot#error-identifiers

Original support for optional identifiers added in #97, this adds a default one which you can still override as before. Previously, the identifier would be added, now it would override the default one.
spaze added a commit that referenced this pull request May 14, 2024
https://phpstan.org/blog/phpstan-1-11-errors-identifiers-phpstan-pro-reboot#error-identifiers

Original support for optional identifiers added in #97, this adds a default one which you can still override as before. Previously, the identifier would be added, now it would override the default one.
spaze added a commit that referenced this pull request May 14, 2024
https://phpstan.org/blog/phpstan-1-11-errors-identifiers-phpstan-pro-reboot#error-identifiers

Original support for optional identifiers added in #97, this adds a default one which you can still override as before. Previously, the identifier would be added, now it would override the default one.
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.

None yet

2 participants