@@ -228,6 +228,10 @@ private function handleTypedProperty(Node $node): void
228
228
return ;
229
229
}
230
230
231
+ if (FullyQualifiedClassName::isNotAValidFqcn ($ type ->toString ())) {
232
+ return ;
233
+ }
234
+
231
235
try {
232
236
$ this ->classDescriptionBuilder
233
237
->addDependency (new ClassDependency ($ type ->toString (), $ node ->getLine ()));
@@ -288,10 +292,17 @@ private function handleReturnTypeDependency(Node $node): void
288
292
{
289
293
if ($ node instanceof Node \Stmt \ClassMethod) {
290
294
$ returnType = $ node ->returnType ;
291
- if ( $ returnType instanceof Node \ Name \FullyQualified) {
292
- $ this -> classDescriptionBuilder
293
- -> addDependency ( new ClassDependency ( $ returnType -> toString (), $ returnType -> getLine ())) ;
295
+
296
+ if (! $ returnType instanceof Node \ Name \FullyQualified) {
297
+ return ;
294
298
}
299
+
300
+ if (FullyQualifiedClassName::isNotAValidFqcn ($ returnType ->toString ())) {
301
+ return ;
302
+ }
303
+
304
+ $ this ->classDescriptionBuilder
305
+ ->addDependency (new ClassDependency ($ returnType ->toString (), $ returnType ->getLine ()));
295
306
}
296
307
}
297
308
@@ -300,10 +311,16 @@ private function handleAttributeNode(Node $node): void
300
311
if ($ node instanceof Node \Attribute) {
301
312
$ nodeName = $ node ->name ;
302
313
303
- if ($ nodeName instanceof Node \Name \FullyQualified) {
304
- $ this ->classDescriptionBuilder
305
- ->addAttribute ($ node ->name ->toString (), $ node ->getLine ());
314
+ if (!$ nodeName instanceof Node \Name \FullyQualified) {
315
+ return ;
316
+ }
317
+
318
+ if (FullyQualifiedClassName::isNotAValidFqcn ($ nodeName ->toString ())) {
319
+ return ;
306
320
}
321
+
322
+ $ this ->classDescriptionBuilder
323
+ ->addAttribute ($ nodeName ->toString (), $ node ->getLine ());
307
324
}
308
325
}
309
326
@@ -337,6 +354,10 @@ private function addParamDependency(Node\Param $node): void
337
354
return ;
338
355
}
339
356
357
+ if (FullyQualifiedClassName::isNotAValidFqcn ($ type ->toString ())) {
358
+ return ;
359
+ }
360
+
340
361
$ this ->classDescriptionBuilder
341
362
->addDependency (new ClassDependency ($ type ->toString (), $ node ->getLine ()));
342
363
}
0 commit comments