Skip to content

Add example combining disallowInInstanceOf wildcard with classPattern#417

Merged
spaze merged 1 commit into
mainfrom
spaze/docs-instance-of-wildcard-with-class-pattern
Apr 27, 2026
Merged

Add example combining disallowInInstanceOf wildcard with classPattern#417
spaze merged 1 commit into
mainfrom
spaze/docs-instance-of-wildcard-with-class-pattern

Conversation

@spaze
Copy link
Copy Markdown
Owner

@spaze spaze commented Apr 26, 2026

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.

@spaze spaze self-assigned this Apr 26, 2026
@spaze spaze marked this pull request as ready for review April 26, 2026 23:54
Copilot AI review requested due to automatic review settings April 26, 2026 23:54
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 with allowExceptParamsInAllowed using classPattern.
  • 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.

Comment thread docs/allow-in-instance-of.md Outdated
…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.
@spaze spaze force-pushed the spaze/docs-instance-of-wildcard-with-class-pattern branch from 9e1ef12 to 83dab80 Compare April 27, 2026 00:03
@spaze spaze requested a review from Copilot April 27, 2026 00:04
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@spaze spaze merged commit d0af76f into main Apr 27, 2026
154 checks passed
@spaze spaze deleted the spaze/docs-instance-of-wildcard-with-class-pattern branch April 27, 2026 00:10
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.

2 participants