Skip to content

Commit

Permalink
Cleanup: use hasByName() over getTagsByName() (#5797)
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Apr 3, 2024
1 parent 3f1ccb3 commit e503792
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ private function isReadonlyProperty(Property $property): bool

// @readonly annotation
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($property);
$tags = $phpDocInfo->getTagsByName('@readonly');
return $tags !== [];
return $phpDocInfo->hasByName('@readonly');
}

private function isReadonlyClass(Class_ $class): bool
Expand All @@ -143,7 +142,6 @@ private function isReadonlyClass(Class_ $class): bool

// @immutable annotation
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($class);
$tags = $phpDocInfo->getTagsByName('@immutable');
return $tags !== [];
return $phpDocInfo->hasByName('@immutable');
}
}

0 comments on commit e503792

Please sign in to comment.