diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index eec5b8aa3f3..78c13517e0e 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -90,7 +90,9 @@ * requireSQLConversion?: bool, * declared?: class-string, * declaredField?: string, - * options?: array + * options?: array, + * version?: string, + * default?: string|int, * } * @psalm-type JoinColumnData = array{ * name: string, @@ -1582,9 +1584,9 @@ private function isTypedProperty(string $name): bool /** * Validates & completes the given field mapping based on typed property. * - * @param array{fieldName: string, type?: mixed} $mapping The field mapping to validate & complete. + * @param array{fieldName: string, type?: string} $mapping The field mapping to validate & complete. * - * @return array{fieldName: string, enumType?: string, type?: mixed} The updated mapping. + * @return array{fieldName: string, enumType?: class-string, type?: string} The updated mapping. */ private function validateAndCompleteTypedFieldMapping(array $mapping): array { @@ -1628,7 +1630,7 @@ private function validateAndCompleteTypedAssociationMapping(array $mapping): arr * enumType?: class-string, * } $mapping The field mapping to validate & complete. * - * @return mixed[] The updated mapping. + * @return FieldMapping The updated mapping. * * @throws MappingException */ diff --git a/lib/Doctrine/ORM/Mapping/TypedFieldMapper.php b/lib/Doctrine/ORM/Mapping/TypedFieldMapper.php index faf84dbd755..2db9e903dfa 100644 --- a/lib/Doctrine/ORM/Mapping/TypedFieldMapper.php +++ b/lib/Doctrine/ORM/Mapping/TypedFieldMapper.php @@ -4,6 +4,7 @@ namespace Doctrine\ORM\Mapping; +use BackedEnum; use ReflectionProperty; interface TypedFieldMapper @@ -11,9 +12,9 @@ interface TypedFieldMapper /** * Validates & completes the given field mapping based on typed property. * - * @param array{fieldName: string, enumType?: string, type?: mixed} $mapping The field mapping to validate & complete. + * @param array{fieldName: string, enumType?: class-string, type?: string} $mapping The field mapping to validate & complete. * - * @return array{fieldName: string, enumType?: string, type?: mixed} The updated mapping. + * @return array{fieldName: string, enumType?: class-string, type?: string} The updated mapping. */ public function validateAndComplete(array $mapping, ReflectionProperty $field): array; } diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 37698eed36c..046d7eb52c7 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -575,11 +575,6 @@ parameters: count: 1 path: lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php - - - message: "#^Offset 'version' on array\\{type\\: string, fieldName\\: string, columnName\\: string, length\\?\\: int, id\\?\\: bool, nullable\\?\\: bool, notInsertable\\?\\: bool, notUpdatable\\?\\: bool, \\.\\.\\.\\} in isset\\(\\) does not exist\\.$#" - count: 1 - path: lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php - - message: "#^Parameter \\#1 \\$policy of method Doctrine\\\\ORM\\\\Tools\\\\Export\\\\Driver\\\\AbstractExporter\\:\\:_getChangeTrackingPolicyString\\(\\) expects 1\\|2\\|3, int given\\.$#" count: 1 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 97aded1a4c7..3e74d9245df 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -2694,9 +2694,6 @@ AbstractExporter - - $field['version'] - $_extension