Skip to content

Conversation

@fain182
Copy link
Collaborator

@fain182 fain182 commented Dec 26, 2025

PHP core classes (DateTime, Exception, PDO, etc.) are now automatically filtered during dependency extraction in ClassDescriptionBuilder. This eliminates the need for users to manually exclude them in rules.

Changes:

  • Add isPhpCoreClass() method to ClassDescriptionBuilder that uses ReflectionClass::isInternal() to accurately distinguish PHP built-in classes from user-defined classes in the root namespace
  • Remove obsolete excludeCoreNamespace parameter from NotHaveDependencyOutsideNamespace rule (no longer needed)
  • Add comprehensive tests for PHP core class filtering
  • Update README to document automatic exclusion behavior

The filtering is more precise than the previous approach - it only excludes actual PHP internal classes, not all classes without a namespace, preventing false negatives for legacy user-defined classes.

@fain182 fain182 force-pushed the claude/fix-issue-338-iv0tO branch 2 times, most recently from a063196 to 9b0eb11 Compare December 26, 2025 21:46
PHP core classes (DateTime, Exception, PDO, etc.) are now automatically
filtered during dependency extraction in ClassDescriptionBuilder. This
eliminates the need for users to manually exclude them in rules.

Changes:
- Add isPhpCoreClass() method to ClassDescriptionBuilder that uses
  ReflectionClass::isInternal() to accurately detect PHP built-in
  classes from both core and extensions (including namespaced ones
  like MongoDB\Driver\Manager, Swoole\Server)
- Remove obsolete excludeCoreNamespace parameter from
  NotHaveDependencyOutsideNamespace rule (no longer needed)
- Add comprehensive tests for PHP core class filtering, including
  verification that internal namespaced classes are also filtered
- Update README to document automatic exclusion behavior

The filtering uses Reflection on all dependencies, not just root
namespace classes, ensuring extensions with namespaced classes
(MongoDB, Swoole, etc.) are also correctly excluded.
@fain182 fain182 force-pushed the claude/fix-issue-338-iv0tO branch from 9b0eb11 to 7d5f129 Compare December 26, 2025 21:52
@codecov
Copy link

codecov bot commented Dec 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.69%. Comparing base (92158af) to head (7d5f129).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #552      +/-   ##
============================================
- Coverage     97.74%   97.69%   -0.05%     
- Complexity      614      615       +1     
============================================
  Files            79       79              
  Lines          1775     1781       +6     
============================================
+ Hits           1735     1740       +5     
- Misses           40       41       +1     

☔ 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.

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