From 1ac05f5e4e2819d092e7c9605d0758370f6acfc8 Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Sun, 24 Apr 2022 17:52:28 +0200 Subject: [PATCH] Fix type on ClassMetadata discriminatorMap (#9675) --- 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 f236c5bb1e..aa47def440 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 bb7e666e89..f8422b1f0c 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 ad5b01db83..1a5ef25ad7 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -653,7 +653,8 @@ $table $tableGeneratorDefinition - + + $this->discriminatorMap $this->entityListeners $this->fieldMappings $this->fullyQualifiedClassName($repositoryClassName)