Skip to content

Commit

Permalink
Adapt tests, upgrade cs and fix static coding violations and baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Oct 11, 2023
1 parent 2db1f76 commit 2d31d71
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 17 deletions.
1 change: 0 additions & 1 deletion lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Doctrine\ORM\Id\BigIntegerIdentityGenerator;
use Doctrine\ORM\Id\IdentityGenerator;
use Doctrine\ORM\Id\SequenceGenerator;
use Doctrine\ORM\Mapping\Exception\CannotGenerateIds;
use Doctrine\ORM\Mapping\Exception\InvalidCustomGenerator;
use Doctrine\ORM\Mapping\Exception\UnknownGeneratorType;
use Doctrine\Persistence\Mapping\AbstractClassMetadataFactory;
Expand Down
76 changes: 75 additions & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,84 @@
</PossiblyNullArgument>
</file>
<file src="lib/Doctrine/ORM/Mapping/ClassMetadata.php">
<PropertyNotSetInConstructor/>
<DeprecatedProperty>
<code><![CDATA[$this->columnNames]]></code>
<code><![CDATA[$this->columnNames]]></code>
<code><![CDATA[$this->columnNames]]></code>
<code><![CDATA[$this->columnNames]]></code>
</DeprecatedProperty>
<InvalidArgument>
<code>$mapping</code>
<code>$mapping</code>
<code>$mapping</code>
<code>$mapping</code>
<code>$overrideMapping</code>
</InvalidArgument>
<InvalidNullableReturnType>
<code>ReflectionClass|null</code>
</InvalidNullableReturnType>
<InvalidPropertyAssignmentValue>
<code>$definition</code>
<code><![CDATA[$this->subClasses]]></code>
</InvalidPropertyAssignmentValue>
<LessSpecificReturnStatement>
<code>$className</code>
<code>$className</code>
<code><![CDATA[$this->namespace . '\\' . $className]]></code>
</LessSpecificReturnStatement>
<MoreSpecificReturnType>
<code>class-string|null</code>
</MoreSpecificReturnType>
<NullableReturnStatement>
<code><![CDATA[$this->reflClass]]></code>
</NullableReturnStatement>
<ParamNameMismatch>
<code>$entity</code>
</ParamNameMismatch>
<PossiblyNullArgument>
<code>$class</code>
<code>$className</code>
<code><![CDATA[$mapping['targetEntity']]]></code>
<code><![CDATA[$mapping['targetEntity']]]></code>
<code><![CDATA[$parentReflFields[$embeddedClass->declaredField]]]></code>
</PossiblyNullArgument>
<PossiblyNullReference>
<code>getProperty</code>
<code>getProperty</code>
<code>getProperty</code>
<code>getValue</code>
<code>getValue</code>
<code>getValue</code>
<code>instantiate</code>
<code>setValue</code>
<code>setValue</code>
</PossiblyNullReference>
<PossiblyUndefinedArrayOffset>
<code><![CDATA[$mapping['isOwningSide']]]></code>
<code><![CDATA[$mapping['isOwningSide']]]></code>
<code><![CDATA[$mapping['isOwningSide']]]></code>
<code><![CDATA[$mapping['targetEntity']]]></code>
<code><![CDATA[$table['name']]]></code>
</PossiblyUndefinedArrayOffset>
<PropertyNotSetInConstructor>
<code>$idGenerator</code>
<code>$table</code>
</PropertyNotSetInConstructor>
<RedundantCondition>
<code>$mapping !== false</code>
<code>$mapping !== false</code>
</RedundantCondition>
<RedundantFunctionCall>
<code>array_values</code>
</RedundantFunctionCall>
<RedundantPropertyInitializationCheck>
<code><![CDATA[$this->table]]></code>
<code>null</code>
</RedundantPropertyInitializationCheck>
</file>
<file src="lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php">
<ArgumentTypeCoercion>
<code>$platformFamily</code>
<code><![CDATA[new $definition['class']()]]></code>
</ArgumentTypeCoercion>
<InvalidArrayOffset>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use Doctrine\ORM\Mapping\JoinColumn;
use Doctrine\ORM\Mapping\ManyToOne;
use Doctrine\ORM\Mapping\Table;
use Doctrine\Tests\Models\CMS\CmsAddress;
use Doctrine\Tests\OrmFunctionalTestCase;
use PHPUnit\Framework\Attributes\Group;

Expand All @@ -32,13 +31,6 @@ protected function setUp(): void
}
}

public function testPostgresMetadataSequenceIncrementedBy10(): void
{
$address = $this->_em->getClassMetadata(CmsAddress::class);

self::assertEquals(1, $address->sequenceGeneratorDefinition['allocationSize']);
}

#[Group('DDC-1657')]
public function testUpdateSchemaWithPostgreSQLSchema(): void
{
Expand Down
6 changes: 0 additions & 6 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/DDC832Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Doctrine\Tests\ORM\Functional\Ticket;

use Doctrine\DBAL\Platforms\OraclePlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\DiscriminatorColumn;
use Doctrine\ORM\Mapping\DiscriminatorMap;
Expand Down Expand Up @@ -43,11 +42,6 @@ public function tearDown(): void
$sm->dropTable($platform->quoteIdentifier('TREE_INDEX'));
$sm->dropTable($platform->quoteIdentifier('INDEX'));
$sm->dropTable($platform->quoteIdentifier('LIKE'));

if ($platform instanceof PostgreSQLPlatform) {
$sm->dropSequence($platform->quoteIdentifier('INDEX_id_seq'));
$sm->dropSequence($platform->quoteIdentifier('LIKE_id_seq'));
}
}

#[Group('DDC-832')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\OraclePlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\Deprecations\PHPUnit\VerifyDeprecations;
use Doctrine\ORM\Configuration;
use Doctrine\ORM\EntityManagerInterface;
Expand Down

0 comments on commit 2d31d71

Please sign in to comment.