Commit 311ac20
Resolve class-node lookup inside the single-element loop instead of suppressing errors
The class branch's $files is always a single-element [$file], so the now
non-empty array inference proved the post-loop $fetchedClassNode === null check
dead and left $file as a foreach value variable that PHPStan treats as
possibly-undefined after the loop. Building the reflection inside the loop drops
the dead check and the post-loop variable use, removing both @PHPStan-Ignore
comments rather than suppressing the warnings.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 80280f6 commit 311ac20
1 file changed
Lines changed: 5 additions & 10 deletions
Lines changed: 5 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | 114 | | |
116 | 115 | | |
117 | 116 | | |
| |||
121 | 120 | | |
122 | 121 | | |
123 | 122 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | 123 | | |
130 | | - | |
131 | | - | |
132 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
133 | 127 | | |
134 | | - | |
| 128 | + | |
| 129 | + | |
135 | 130 | | |
136 | 131 | | |
137 | 132 | | |
| |||
0 commit comments