diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/CompatibilityAnnotationDriver.php b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/CompatibilityAnnotationDriver.php index 755077103f..08956fd8e4 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/CompatibilityAnnotationDriver.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/CompatibilityAnnotationDriver.php @@ -9,18 +9,18 @@ use function class_exists; -if (class_exists(PersistenceAnnotationDriver::class)) { +if (! class_exists(PersistenceAnnotationDriver::class)) { /** * @internal This class will be removed in ODM 3.0. */ - abstract class CompatibilityAnnotationDriver extends PersistenceAnnotationDriver + abstract class CompatibilityAnnotationDriver implements MappingDriver { } } else { /** * @internal This class will be removed in ODM 3.0. */ - abstract class CompatibilityAnnotationDriver implements MappingDriver + abstract class CompatibilityAnnotationDriver extends PersistenceAnnotationDriver { } } diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 6bf01e68db..dad54e2caf 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -220,3 +220,14 @@ parameters: message: "#.+mapField\\(\\) expects.+enumType\\: 'Documents81#" count: 2 path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ClassMetadataTest.php + + # it loads an empty class ReflectionEnum of ReflectionEnumPolyfill.php file from laminas/laminas-code, see https://github.com/phpstan/phpstan/issues/7290 + - + message: "#^Call to an undefined method ReflectionEnum\\:\\:isBacked\\(\\)\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php + + - + message: "#^Call to an undefined method ReflectionEnum\\:\\:getBackingType\\(\\)\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php diff --git a/tests/Documents81/Suit.php b/tests/Documents81/Suit.php index 30ed52d0fd..1a57e2340a 100644 --- a/tests/Documents81/Suit.php +++ b/tests/Documents81/Suit.php @@ -6,8 +6,8 @@ enum Suit: string { - case Hearts = 'H'; + case Hearts = 'H'; case Diamonds = 'D'; - case Clubs = 'C'; - case Spades = 'S'; + case Clubs = 'C'; + case Spades = 'S'; } diff --git a/tests/Documents81/SuitInt.php b/tests/Documents81/SuitInt.php index 13a948b2c9..9a06f94d84 100644 --- a/tests/Documents81/SuitInt.php +++ b/tests/Documents81/SuitInt.php @@ -6,8 +6,8 @@ enum SuitInt: int { - case Hearts = 1; + case Hearts = 1; case Diamonds = 2; - case Clubs = 3; - case Spades = 4; + case Clubs = 3; + case Spades = 4; }