Commit 119d849
Skip extension for non-native reflection classes instead of removing declaring class check entirely
The previous approach (removing the declaring class check entirely) caused the
extension to fire during self-analysis where BetterReflection adapters override
getAttributes(). This overrode BetterReflection's accurate return type with the
native ReflectionAttribute type, which lacks getArgumentsExpressions().
Instead of checking declaring class name === className (which fails for union
types because UnionTypeMethodReflection returns only the first member's declaring
class), check that the declaring class is a native PHP class (no namespace
separator). This correctly:
- Fires for user code (declaring class is native ReflectionClass etc.)
- Fires for union types (declaring class is first member's native class)
- Skips BetterReflection adapters during self-analysis (namespaced classes)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 8ef891f commit 119d849
File tree
2 files changed
+4
-2
lines changed- src
- Reflection
- Type/Php
2 files changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1570 | 1570 | | |
1571 | 1571 | | |
1572 | 1572 | | |
1573 | | - | |
| 1573 | + | |
1574 | 1574 | | |
1575 | 1575 | | |
1576 | 1576 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
0 commit comments