Skip to content

Commit 642a20b

Browse files
committed
Merge branch '2.15.x' into 3.0.x
* 2.15.x: Psalm 5.6.0, PHPStan 1.9.14 (doctrine#10468) Fix some tests that were missed in doctrine#10431 (doctrine#10464) Remove commented-out code sections (doctrine#10465)
2 parents 4d8cf26 + 2ee936a commit 642a20b

7 files changed

+8
-21
lines changed

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
"require-dev": {
3939
"doctrine/coding-standard": "^11.0",
4040
"phpbench/phpbench": "^1.0",
41-
"phpstan/phpstan": "1.9.8",
41+
"phpstan/phpstan": "1.9.14",
4242
"phpunit/phpunit": "^9.5.28",
4343
"psr/log": "^1 || ^2 || ^3",
4444
"squizlabs/php_codesniffer": "3.7.1",
4545
"symfony/cache": "^5.4 || ^6.0",
4646
"symfony/var-exporter": "^5.4 || ^6.2",
47-
"vimeo/psalm": "5.5.0"
47+
"vimeo/psalm": "5.6.0"
4848
},
4949
"suggest": {
5050
"ext-dom": "Provides support for XSD validation for XML mapping files",

lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php

-2
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ protected function doLoadMetadata(
144144
$class->name,
145145
end($nonSuperclassParents),
146146
);
147-
// enable this in 3.0
148-
// throw MappingException::missingInheritanceTypeDeclaration(end($nonSuperclassParents), $class->name);
149147
}
150148

151149
foreach ($class->embeddedClasses as $property => $embeddableClass) {

phpstan-baseline.neon

-5
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,6 @@ parameters:
295295
count: 3
296296
path: lib/Doctrine/ORM/Query/Parser.php
297297

298-
-
299-
message: "#^Access to an undefined property Doctrine\\\\ORM\\\\Query\\\\AST\\\\Node\\:\\:\\$pathExpression\\.$#"
300-
count: 1
301-
path: lib/Doctrine/ORM/Query/SqlWalker.php
302-
303298
-
304299
message: "#^Call to function is_string\\(\\) with Doctrine\\\\ORM\\\\Query\\\\AST\\\\Node will always evaluate to false\\.$#"
305300
count: 1

psalm-baseline.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="5.5.0@b63061a27f2683ec0f3509012bb22daab3b65b61">
2+
<files psalm-version="5.6.0@e784128902dfe01d489c4123d69918a9f3c1eac5">
33
<file src="lib/Doctrine/ORM/AbstractQuery.php">
44
<FalsableReturnStatement>
55
<code>! $filteredParameters-&gt;isEmpty() ? $filteredParameters-&gt;first() : null</code>

tests/Doctrine/Tests/Models/DDC5934/DDC5934BaseContract.php

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public function __construct()
3333

3434
public static function loadMetadata(ClassMetadata $metadata): void
3535
{
36+
$metadata->isMappedSuperclass = true;
37+
3638
$metadata->mapField([
3739
'id' => true,
3840
'fieldName' => 'id',

tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php

+1-9
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,7 @@ public function testUndeclaredHierarchyRejection(string $rootEntity, string $chi
227227
{
228228
$this->expectDeprecationWithIdentifier('https://github.com/doctrine/orm/pull/10431');
229229

230-
/* on 3.0, use this instead: */
231-
// self::expectException(MappingException::class);
232-
// self::expectExceptionMessage(\sprintf(
233-
// "Entity class '%s' is a subclass of the root entity class '%s', but no inheritance mapping type was declared.",
234-
// $childClass,
235-
// $rootEntity
236-
// ));
237-
238-
$this->cmf->getMetadataFor($childClass);
230+
$this->cmf->getMetadataFor($childClass);
239231
}
240232

241233
public function invalidHierarchyDeclarationClasses(): Generator

tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC5934.DDC5934BaseContract.dcm.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
55
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
66

7-
<entity name="Doctrine\Tests\Models\DDC5934\DDC5934BaseContract">
7+
<mapped-superclass name="Doctrine\Tests\Models\DDC5934\DDC5934BaseContract">
88
<id name="id" type="integer">
99
<generator strategy="AUTO" />
1010
</id>
1111

1212
<many-to-many target-entity="DDC5934Member" inversed-by="contract" fetch="LAZY" field="members" />
13-
</entity>
13+
</mapped-superclass>
1414

1515
</doctrine-mapping>

0 commit comments

Comments
 (0)