diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index e48b24f..d5ee8a7 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -1,6 +1,10 @@ name: Psalm on: + pull_request: + paths: + - '**.php' + - 'psalm.xml.dist' push: paths: - '**.php' diff --git a/src/PropertyFactory.php b/src/PropertyFactory.php index 642a2c2..f2e23a0 100644 --- a/src/PropertyFactory.php +++ b/src/PropertyFactory.php @@ -91,9 +91,15 @@ protected function extractDocBlockType(ReflectionProperty $property): ?string if ($type->isCollection()) { // Patch for Symfony 6 + /** + * @psalm-suppress RedundantCondition + */ if (method_exists($type, 'getCollectionValueTypes')) { $collectionType = $type->getCollectionValueTypes()[0]; } else { + /** + * @psalm-suppress UndefinedMethod + */ $collectionType = $type->getCollectionValueType(); } $className = $collectionType->getClassName() ?? $collectionType->getBuiltinType();