From 3178b4ec4fc2a71872d968091a1a39ca7b53c086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sun, 13 Nov 2022 19:03:22 +0100 Subject: [PATCH] Widen parameter type This exception is used in two places, one where $generatedMode is clearly a string, and another where typing it as a string will cause a type error, because $generatedMode is supposed to be an int there. --- lib/Doctrine/ORM/Mapping/MappingException.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Mapping/MappingException.php b/lib/Doctrine/ORM/Mapping/MappingException.php index 875f9f07594..2d069cdc420 100644 --- a/lib/Doctrine/ORM/Mapping/MappingException.php +++ b/lib/Doctrine/ORM/Mapping/MappingException.php @@ -824,7 +824,8 @@ public static function invalidFetchMode($className, $annotation) return new self("Entity '" . $className . "' has a mapping with invalid fetch mode '" . $annotation . "'"); } - public static function invalidGeneratedMode(string $annotation): MappingException + /** @param int|string $annotation */ + public static function invalidGeneratedMode($annotation): MappingException { return new self("Invalid generated mode '" . $annotation . "'"); }