From 1d926520364038773ed4157d5a4000378de0d22a Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Thu, 26 Jan 2023 12:59:38 +0000 Subject: [PATCH] Remove commented-out code sections This removes comments added in #10431 on the 2.15.x branch, as suggested in https://github.com/doctrine/orm/pull/10460#issuecomment-1404889903. --- lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php | 2 -- lib/Doctrine/ORM/Mapping/MappingException.php | 13 ------------- .../ORM/Mapping/BasicInheritanceMappingTest.php | 10 +--------- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php index f1b4292d291..845bcc3be81 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php @@ -156,8 +156,6 @@ protected function doLoadMetadata($class, $parent, $rootEntityFound, array $nonS $class->name, end($nonSuperclassParents) ); - // enable this in 3.0 - // throw MappingException::missingInheritanceTypeDeclaration(end($nonSuperclassParents), $class->name); } foreach ($class->embeddedClasses as $property => $embeddableClass) { diff --git a/lib/Doctrine/ORM/Mapping/MappingException.php b/lib/Doctrine/ORM/Mapping/MappingException.php index 4714047122d..9fd3f032eda 100644 --- a/lib/Doctrine/ORM/Mapping/MappingException.php +++ b/lib/Doctrine/ORM/Mapping/MappingException.php @@ -539,19 +539,6 @@ static function ($a, $b) { ); } - /** - * @param class-string $rootEntityClass - * @param class-string $childEntityClass - */ - //public static function missingInheritanceTypeDeclaration(string $rootEntityClass, string $childEntityClass): self - //{ - // return new self(sprintf( - // "Entity class '%s' is a subclass of the root entity class '%s', but no inheritance mapping type was declared.", - // $childEntityClass, - // $rootEntityClass - // )); - //} - /** * @param string $className * diff --git a/tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php b/tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php index 3a74bcbc39a..f7106736c64 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php @@ -230,15 +230,7 @@ public function testUndeclaredHierarchyRejection(string $rootEntity, string $chi { $this->expectDeprecationWithIdentifier('https://github.com/doctrine/orm/pull/10431'); - /* on 3.0, use this instead: */ - // self::expectException(MappingException::class); - // self::expectExceptionMessage(\sprintf( - // "Entity class '%s' is a subclass of the root entity class '%s', but no inheritance mapping type was declared.", - // $childClass, - // $rootEntity - // )); - - $this->cmf->getMetadataFor($childClass); + $this->cmf->getMetadataFor($childClass); } public function invalidHierarchyDeclarationClasses(): Generator