Skip to content

Commit 91a10a8

Browse files
committed
Fix phpstan errors
1 parent fc236da commit 91a10a8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,8 +2617,6 @@ private function validateAndCompleteTypedFieldMapping(array $mapping): array
26172617
}
26182618

26192619
if (PHP_VERSION_ID >= 80100 && ! $type->isBuiltin() && enum_exists($type->getName())) {
2620-
$mapping['enumType'] = $type->getName();
2621-
26222620
$reflection = new ReflectionEnum($type->getName());
26232621
$type = $reflection->getBackingType();
26242622

@@ -2627,6 +2625,7 @@ private function validateAndCompleteTypedFieldMapping(array $mapping): array
26272625
}
26282626

26292627
assert($type instanceof ReflectionNamedType);
2628+
$mapping['enumType'] = $type->getName();
26302629
}
26312630

26322631
switch ($type->getName()) {

phpstan-baseline.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,11 @@ parameters:
445445
count: 1
446446
path: lib/Doctrine/ODM/MongoDB/Hydrator/HydratorFactory.php
447447

448+
-
449+
message: "#^Parameter \\#2 \\$enumType of class Doctrine\\\\Persistence\\\\Reflection\\\\EnumReflectionProperty constructor expects class\\-string\\<BackedEnum\\>, class\\-string\\<UnitEnum\\> given\\.$#"
450+
count: 1
451+
path: lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php
452+
448453
-
449454
message: "#^Parameter \\#2 \\$mapping of method Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\Driver\\\\XmlDriver\\:\\:addFieldMapping\\(\\) expects array\\{type\\?\\: string, fieldName\\?\\: string, name\\?\\: string, strategy\\?\\: string, association\\?\\: int, id\\?\\: bool, isOwningSide\\?\\: bool, collectionClass\\?\\: class\\-string, \\.\\.\\.\\}, array\\<string, non\\-empty\\-array\\<int, string\\>\\|bool\\|string\\> given\\.$#"
450455
count: 1

0 commit comments

Comments
 (0)