@@ -383,7 +383,7 @@ private function postProcessNode(Node $node): void
383
383
384
384
$ newDocComment = $ this ->addTags ($ name , $ docComment );
385
385
386
- if ($ newDocComment !== null ) {
386
+ if ($ newDocComment instanceof Doc ) {
387
387
$ node ->setDocComment ($ newDocComment );
388
388
}
389
389
@@ -399,7 +399,7 @@ private function postProcessNode(Node $node): void
399
399
400
400
$ newDocComment = $ this ->addStringTags ($ name , $ docComment );
401
401
402
- if ($ newDocComment !== null ) {
402
+ if ($ newDocComment instanceof Doc ) {
403
403
$ node ->setDocComment ($ newDocComment );
404
404
}
405
405
}
@@ -434,23 +434,23 @@ private function generateAdditionalTagsFromDoc(Doc $docComment): array
434
434
foreach ($ params as $ param ) {
435
435
$ addition = self ::getAdditionFromParam ($ param );
436
436
437
- if ($ addition !== null ) {
437
+ if ($ addition instanceof WordPressTag ) {
438
438
$ additions [] = $ addition ;
439
439
}
440
440
}
441
441
442
442
foreach ($ returns as $ return ) {
443
443
$ addition = self ::getAdditionFromReturn ($ return );
444
444
445
- if ($ addition !== null ) {
445
+ if ($ addition instanceof WordPressTag ) {
446
446
$ additions [] = $ addition ;
447
447
}
448
448
}
449
449
450
450
foreach ($ vars as $ var ) {
451
451
$ addition = self ::getAdditionFromVar ($ var );
452
452
453
- if ($ addition !== null ) {
453
+ if ($ addition instanceof WordPressTag ) {
454
454
$ additions [] = $ addition ;
455
455
}
456
456
}
@@ -549,7 +549,7 @@ private function getInheritedTagsForParam(Param $param): array
549
549
{
550
550
$ type = $ param ->getType ();
551
551
552
- if ($ type === null ) {
552
+ if (! $ type instanceof Type ) {
553
553
return [];
554
554
}
555
555
@@ -561,7 +561,7 @@ private function getInheritedTagsForParam(Param $param): array
561
561
562
562
$ paramDescription = $ param ->getDescription ();
563
563
564
- if ($ paramDescription === null ) {
564
+ if (! $ paramDescription instanceof Description ) {
565
565
return [];
566
566
}
567
567
@@ -587,7 +587,7 @@ private function getInheritedTagsForParam(Param $param): array
587
587
588
588
$ match = self ::getMatchingInheritedTag ($ param , $ tags , $ symbolName );
589
589
590
- if ($ match !== null ) {
590
+ if ($ match instanceof WordPressTag ) {
591
591
$ additions [] = $ match ;
592
592
}
593
593
}
@@ -698,7 +698,7 @@ private function getAdditionFromParam(Param $tag): ?WordPressTag
698
698
$ tagVariableType = $ tag ->getType ();
699
699
700
700
// Skip if information we need is missing.
701
- if (!$ tagDescription || !$ tagVariableName || !$ tagVariableType ) {
701
+ if (!$ tagDescription instanceof Description || !$ tagVariableName || !$ tagVariableType instanceof Type ) {
702
702
return null ;
703
703
}
704
704
@@ -744,7 +744,7 @@ private function getAdditionFromReturn(Return_ $tag): ?WordPressTag
744
744
$ tagVariableType = $ tag ->getType ();
745
745
746
746
// Skip if information we need is missing.
747
- if (!$ tagDescription || !$ tagVariableType ) {
747
+ if (!$ tagDescription instanceof Description || !$ tagVariableType instanceof Type ) {
748
748
return null ;
749
749
}
750
750
@@ -784,7 +784,7 @@ private static function getAdditionFromVar(Var_ $tag): ?WordPressTag
784
784
$ tagVariableType = $ tag ->getType ();
785
785
786
786
// Skip if information we need is missing.
787
- if (!$ tagDescription || !$ tagVariableType ) {
787
+ if (!$ tagDescription instanceof Description || !$ tagVariableType instanceof Type ) {
788
788
return null ;
789
789
}
790
790
@@ -1008,7 +1008,7 @@ private function voidOrNever(Node $node): string
1008
1008
static function (Node $ node ): bool {
1009
1009
return isset ($ node ->expr );
1010
1010
}
1011
- ) !== null
1011
+ ) instanceof Node
1012
1012
) {
1013
1013
return '' ;
1014
1014
}
0 commit comments