File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -190,11 +190,21 @@ private function getParentClassStatements(): ?array
190
190
return [];
191
191
}
192
192
193
- if (null !== $ usedClasses [$ this ->getParentClassName ()]) {
193
+ if (null !== @ $ usedClasses [$ this ->getParentClassName ()]) {
194
194
$ parentClass = $ usedClasses [$ this ->getParentClassName ()];
195
195
}
196
196
197
- $ rc = new ReflectionClass ($ parentClass );
197
+ try {
198
+ $ rc = new ReflectionClass ($ parentClass );
199
+ }
200
+ catch (\ReflectionException $ e ) {
201
+ try {
202
+ $ rc = new ReflectionClass ($ this ->getNamespace () . '\\' . $ parentClass );
203
+ }
204
+ catch (\ReflectionException $ e ) {
205
+ throw new ReflectionException ("Parent class [ {$ parentClass }] for [ {$ this ->getNamespace ()}\\{$ this ->getClassName ()}] not found! " , $ e ->getCode (), $ e );
206
+ }
207
+ }
198
208
$ filename = $ rc ->getFileName ();
199
209
200
210
if (false === $ filename ) {
You can’t perform that action at this time.
0 commit comments