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

Introduce ForbiddenClassNameExtension for append additional forbidden… #2979

Merged

Conversation

kamil-zacek
Copy link
Contributor

… class prefixes

@staabm
Copy link
Contributor

staabm commented Mar 19, 2024

Could you give us an idea what your use-case is?

Is it php-scoper related or something completely different?

@kamil-zacek kamil-zacek force-pushed the kamil-proxy-class-detection branch 2 times, most recently from 4d9a668 to 079cf09 Compare March 19, 2024 12:21
@ondrejmirtes
Copy link
Member

@staabm This was discussed outside of GitHub. The idea is that you want to report usages of classes that you're not supposed to use in application. For example: Generated Doctrine proxies from their configured namespace.

Copy link
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

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

The only other problem is that this isn't tested. Please create a new RuleTestCase for one of the rules affected by this, add an example new neon file with a new extension implementing this interface, and reference it in public static function getAdditionalConfigFiles() in that test case. That way this extension will be added to the container.

src/Classes/ForbiddenClassNameExtension.php Show resolved Hide resolved
@kamil-zacek kamil-zacek marked this pull request as draft March 19, 2024 12:32
@kamil-zacek kamil-zacek force-pushed the kamil-proxy-class-detection branch 5 times, most recently from cca38e7 to 1632a7c Compare March 19, 2024 15:57
@kamil-zacek kamil-zacek marked this pull request as ready for review March 19, 2024 16:06
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes
Copy link
Member

Perfect, thank you!

@ondrejmirtes ondrejmirtes merged commit 0f8a352 into phpstan:1.10.x Mar 20, 2024
440 of 442 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants