use findChildrenOfClass() instead of interface + filter

This commit is contained in:
Tomas Votruba 2019-09-02 19:54:12 +02:00
parent ebbd854a2d
commit 34f8319292

View File

@ -154,14 +154,10 @@ CODE_SAMPLE
throw new ShouldNotHappenException(__METHOD__ . '() on line ' . __LINE__);
}
$childrenClassLikes = $this->parsedNodesByType->findClassesAndInterfacesByType($className);
$childrenClassLikes = $this->parsedNodesByType->findChildrenOfClass($className);
// update their methods as well
foreach ($childrenClassLikes as $childClassLike) {
if (! $childClassLike instanceof Class_) {
continue;
}
$usedTraits = $this->parsedNodesByType->findUsedTraitsInClass($childClassLike);
foreach ($usedTraits as $trait) {
$this->addReturnTypeToMethod($trait, $node, $returnTypeInfo);