From fab38231eb131560b9e68f4d23b412ce56c09cea Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Sat, 23 Apr 2022 17:49:05 +0200 Subject: [PATCH] Fix type on ClassMetadata discriminatorMap --- lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | 4 +++- phpstan-baseline.neon | 4 ++-- psalm-baseline.xml | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index f236c5bb1ee..aa47def440c 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -519,7 +519,9 @@ class ClassMetadataInfo implements ClassMetadata * * @see discriminatorColumn * - * @var mixed + * @var array + * + * @psalm-var array */ public $discriminatorMap = []; diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index bb7e666e893..f8422b1f0c8 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -171,12 +171,12 @@ parameters: path: lib/Doctrine/ORM/Id/TableGenerator.php - - message: "#^Parameter \\#2 \\$discrMap of static method Doctrine\\\\ORM\\\\Internal\\\\Hydration\\\\HydrationException\\:\\:invalidDiscriminatorValue\\(\\) expects array\\, array\\ given\\.$#" + message: "#^Parameter \\#2 \\$discrMap of static method Doctrine\\\\ORM\\\\Internal\\\\Hydration\\\\HydrationException\\:\\:invalidDiscriminatorValue\\(\\) expects array\\, array\\ given\\.$#" count: 1 path: lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php - - message: "#^Parameter \\#2 \\$discrMap of static method Doctrine\\\\ORM\\\\Internal\\\\Hydration\\\\HydrationException\\:\\:invalidDiscriminatorValue\\(\\) expects array\\, array\\ given\\.$#" + message: "#^Parameter \\#2 \\$discrMap of static method Doctrine\\\\ORM\\\\Internal\\\\Hydration\\\\HydrationException\\:\\:invalidDiscriminatorValue\\(\\) expects array\\, array\\ given\\.$#" count: 1 path: lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php diff --git a/psalm-baseline.xml b/psalm-baseline.xml index ad5b01db832..1a5ef25ad74 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -653,7 +653,8 @@ $table $tableGeneratorDefinition - + + $this->discriminatorMap $this->entityListeners $this->fieldMappings $this->fullyQualifiedClassName($repositoryClassName)