Add example combining disallowInInstanceOf wildcard with classPattern#417
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds documentation demonstrating how disallowInInstanceOf wildcard matching can be combined with classPattern parameter conditions to express “disallow a call within a module only when the argument is also from that module”.
Changes:
- Added a new example showing
disallowInInstanceOf: 'App\SomeModule\*'combined withallowExceptParamsInAllowedusingclassPattern. - Included a short PHP snippet illustrating allowed vs disallowed calls based on caller/argument module membership.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ern` Both features were added separately - wildcard support for `allowInInstanceOf`/`disallowInInstanceOf` in #399, and the `classPattern` parameter directive in #412 - but they compose into a pattern that neither covers alone: disallow a general-purpose method within a whole namespace, but only when the argument also comes from that namespace. The new example in `allow-in-instance-of.md` illustrates this with a module-scoped processor where same-module items should be handled directly rather than routed through the general processor.
9e1ef12 to
83dab80
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both features were added separately - wildcard support for
allowInInstanceOf/disallowInInstanceOfin #399, and theclassPatternparameter directive in #412 - but they compose into a pattern that neither covers alone: disallow a general-purpose method within a whole namespace, but only when the argument also comes from that namespace. The new example inallow-in-instance-of.mdillustrates this with a module-scoped processor where same-module items should be handled directly rather than routed through the general processor.