diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 44cb4153e21..f57c40d880a 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -984,12 +984,6 @@ parameters: count: 1 path: src/Mapping/ClassMetadata.php - - - message: '#^Parameter \#1 \$class of method Doctrine\\Persistence\\Mapping\\ReflectionService\:\:getAccessibleProperty\(\) expects class\-string, string given\.$#' - identifier: argument.type - count: 1 - path: src/Mapping/ClassMetadata.php - - message: '#^Parameter \#1 \$mapping of method Doctrine\\ORM\\Mapping\\ClassMetadata\\:\:validateAndCompleteTypedAssociationMapping\(\) expects array\{type\: 1\|2\|4\|8, fieldName\: string, targetEntity\?\: class\-string\}, non\-empty\-array\ given\.$#' identifier: argument.type @@ -1032,18 +1026,6 @@ parameters: count: 2 path: src/Mapping/ClassMetadata.php - - - message: '#^Parameter \#2 \$class of method Doctrine\\ORM\\Mapping\\ClassMetadata\\:\:getAccessibleProperty\(\) expects class\-string, string given\.$#' - identifier: argument.type - count: 1 - path: src/Mapping/ClassMetadata.php - - - - message: '#^Parameter \#3 \$embeddedClass of class Doctrine\\ORM\\Mapping\\ReflectionEmbeddedProperty constructor expects class\-string, string given\.$#' - identifier: argument.type - count: 1 - path: src/Mapping/ClassMetadata.php - - message: '#^Property Doctrine\\ORM\\Mapping\\ClassMetadata\:\:\$customRepositoryClassName with generic class Doctrine\\ORM\\EntityRepository does not specify its types\: T$#' identifier: missingType.generics @@ -1500,12 +1482,36 @@ parameters: count: 1 path: src/Mapping/JoinTableMapping.php + - + message: '#^Method Doctrine\\ORM\\Mapping\\LegacyReflectionFields\:\:__construct\(\) has parameter \$classMetadata with generic class Doctrine\\ORM\\Mapping\\ClassMetadata but does not specify its types\: T$#' + identifier: missingType.generics + count: 1 + path: src/Mapping/LegacyReflectionFields.php + + - + message: '#^Parameter \#1 \$class of method Doctrine\\Persistence\\Mapping\\ReflectionService\:\:getAccessibleProperty\(\) expects class\-string, string given\.$#' + identifier: argument.type + count: 1 + path: src/Mapping/LegacyReflectionFields.php + - message: '#^Method Doctrine\\ORM\\Mapping\\MappedSuperclass\:\:__construct\(\) has parameter \$repositoryClass with generic class Doctrine\\ORM\\EntityRepository but does not specify its types\: T$#' identifier: missingType.generics count: 1 path: src/Mapping/MappedSuperclass.php + - + message: '#^Method Doctrine\\ORM\\Mapping\\PropertyAccessors\\EnumPropertyAccessor\:\:toEnum\(\) should return array\\|BackedEnum but returns array\\.$#' + identifier: return.type + count: 1 + path: src/Mapping/PropertyAccessors/EnumPropertyAccessor.php + + - + message: '#^Parameter \#1 \$callback of function array_map expects \(callable\(BackedEnum\|int\|string\)\: mixed\)\|null, array\{class\-string\, ''from''\} given\.$#' + identifier: argument.type + count: 1 + path: src/Mapping/PropertyAccessors/EnumPropertyAccessor.php + - message: '#^Method Doctrine\\ORM\\Mapping\\QuoteStrategy\:\:getColumnAlias\(\) has parameter \$class with generic class Doctrine\\ORM\\Mapping\\ClassMetadata but does not specify its types\: T$#' identifier: missingType.generics diff --git a/src/Mapping/ClassMetadata.php b/src/Mapping/ClassMetadata.php index aff76fe8c05..f99fe4c4570 100644 --- a/src/Mapping/ClassMetadata.php +++ b/src/Mapping/ClassMetadata.php @@ -2688,7 +2688,7 @@ public function getSequencePrefix(AbstractPlatform $platform): string return $sequencePrefix; } - /** @phpstan-param class-string $class */ + /** @phpstan-param class-string $className */ private function createPropertyAccessor(string $className, string $propertyName): PropertyAccessor { $reflectionProperty = new ReflectionProperty($className, $propertyName); diff --git a/src/Mapping/FieldMapping.php b/src/Mapping/FieldMapping.php index 928497f776c..37b89aebabe 100644 --- a/src/Mapping/FieldMapping.php +++ b/src/Mapping/FieldMapping.php @@ -54,6 +54,7 @@ final class FieldMapping implements ArrayAccess */ public string|null $inherited = null; + /** @var class-string|null */ public string|null $originalClass = null; public string|null $originalField = null; public bool|null $quoted = null; @@ -101,7 +102,7 @@ public function __construct( * scale?: int|null, * unique?: bool|null, * inherited?: string|null, - * originalClass?: string|null, + * originalClass?: class-string|null, * originalField?: string|null, * quoted?: bool|null, * declared?: string|null,