Skip to content

Conversation

@fain182
Copy link
Collaborator

@fain182 fain182 commented Nov 23, 2025

Add a convenience method that simplifies the common pattern of selecting classes by namespace. This allows:

Rule::namespace('Acme')

instead of:

Rule::allClasses()->that(new ResideInOneOfTheseNamespaces('Acme'))

Supports multiple namespaces via variadic parameters. Related to #491

Add a convenience method that simplifies the common pattern of
selecting classes by namespace. This allows:

  Rule::namespace('Acme')

instead of:

  Rule::allClasses()->that(new ResideInOneOfTheseNamespaces('Acme'))

Supports multiple namespaces via variadic parameters.
Related to #491
Tests verify that the shortcut:
- Works correctly to filter classes by namespace
- Detects violations properly
- Supports multiple namespaces
- Produces equivalent results to the full syntax
@fain182 fain182 requested a review from pfazzi November 23, 2025 22:58
@codecov
Copy link

codecov bot commented Nov 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.75%. Comparing base (d7e3f5b) to head (e03e7ba).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #539   +/-   ##
=========================================
  Coverage     97.75%   97.75%           
- Complexity      615      616    +1     
=========================================
  Files            80       80           
  Lines          1778     1780    +2     
=========================================
+ Hits           1738     1740    +2     
  Misses           40       40           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add example showing the shortcut syntax in the introduction section,
right after the standard rule example.
@sonarqubecloud
Copy link

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.

3 participants