Skip to content

Commit

Permalink
Merge branch '2.15.x' into 3.0.x
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
derrabus committed Jan 27, 2023
2 parents 4d8cf26 + 2ee936a commit 642a20b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 21 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
"require-dev": {
"doctrine/coding-standard": "^11.0",
"phpbench/phpbench": "^1.0",
"phpstan/phpstan": "1.9.8",
"phpstan/phpstan": "1.9.14",
"phpunit/phpunit": "^9.5.28",
"psr/log": "^1 || ^2 || ^3",
"squizlabs/php_codesniffer": "3.7.1",
"symfony/cache": "^5.4 || ^6.0",
"symfony/var-exporter": "^5.4 || ^6.2",
"vimeo/psalm": "5.5.0"
"vimeo/psalm": "5.6.0"
},
"suggest": {
"ext-dom": "Provides support for XSD validation for XML mapping files",
Expand Down
2 changes: 0 additions & 2 deletions lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ protected function doLoadMetadata(
$class->name,
end($nonSuperclassParents),
);
// enable this in 3.0
// throw MappingException::missingInheritanceTypeDeclaration(end($nonSuperclassParents), $class->name);
}

foreach ($class->embeddedClasses as $property => $embeddableClass) {
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,6 @@ parameters:
count: 3
path: lib/Doctrine/ORM/Query/Parser.php

-
message: "#^Access to an undefined property Doctrine\\\\ORM\\\\Query\\\\AST\\\\Node\\:\\:\\$pathExpression\\.$#"
count: 1
path: lib/Doctrine/ORM/Query/SqlWalker.php

-
message: "#^Call to function is_string\\(\\) with Doctrine\\\\ORM\\\\Query\\\\AST\\\\Node will always evaluate to false\\.$#"
count: 1
Expand Down
2 changes: 1 addition & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.5.0@b63061a27f2683ec0f3509012bb22daab3b65b61">
<files psalm-version="5.6.0@e784128902dfe01d489c4123d69918a9f3c1eac5">
<file src="lib/Doctrine/ORM/AbstractQuery.php">
<FalsableReturnStatement>
<code>! $filteredParameters-&gt;isEmpty() ? $filteredParameters-&gt;first() : null</code>
Expand Down
2 changes: 2 additions & 0 deletions tests/Doctrine/Tests/Models/DDC5934/DDC5934BaseContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public function __construct()

public static function loadMetadata(ClassMetadata $metadata): void
{
$metadata->isMappedSuperclass = true;

$metadata->mapField([
'id' => true,
'fieldName' => 'id',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">

<entity name="Doctrine\Tests\Models\DDC5934\DDC5934BaseContract">
<mapped-superclass name="Doctrine\Tests\Models\DDC5934\DDC5934BaseContract">
<id name="id" type="integer">
<generator strategy="AUTO" />
</id>

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

</doctrine-mapping>

0 comments on commit 642a20b

Please sign in to comment.