Skip to content

Commit

Permalink
update SA baseline errors
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu committed Apr 5, 2023
1 parent 3930977 commit 564b3fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 142 deletions.
47 changes: 6 additions & 41 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,13 @@ parameters:
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Bucket/AbstractOutput.php

-
message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Densify\\:\\:getExpression\\(\\) has invalid return type Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\DensifyStageExpression\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Densify.php

-
message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Densify\\:\\:getExpression\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Densify.php

-
message: "#^PHPDoc tag @return with type Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\DensifyStageExpression is incompatible with native type array\\.$#"
message: "#^PHPDoc tag @return with type mixed is not subtype of native type array\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Densify.php

Expand All @@ -75,18 +70,13 @@ parameters:
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GraphLookup.php

-
message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Lookup\\:\\:getExpression\\(\\) has invalid return type Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\LookupStageExpression\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php

-
message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Lookup\\:\\:getExpression\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php

-
message: "#^PHPDoc tag @return with type Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\LookupStageExpression is incompatible with native type array\\.$#"
message: "#^PHPDoc tag @return with type mixed is not subtype of native type array\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php

Expand All @@ -95,28 +85,13 @@ parameters:
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php

-
message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Merge\\:\\:getExpression\\(\\) has invalid return type Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\MergeStageExpression\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Merge.php

-
message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Merge\\:\\:getExpression\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Merge.php

-
message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Merge\\:\\:whenMatched\\(\\) has parameter \\$whenMatched with no value type specified in iterable type array\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Merge.php

-
message: "#^PHPDoc tag @return with type Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\MergeStageExpression is incompatible with native type array\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Merge.php

-
message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Merge\\:\\:\\$whenMatched type has no value type specified in iterable type array\\.$#"
message: "#^PHPDoc tag @return with type mixed is not subtype of native type array\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Merge.php

Expand All @@ -135,11 +110,6 @@ parameters:
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Search.php

-
message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Search\\:\\:getExpression\\(\\) has invalid return type Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\SearchStageExpression\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Search.php

-
message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Search\\:\\:getExpression\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
Expand All @@ -151,7 +121,7 @@ parameters:
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Search.php

-
message: "#^PHPDoc tag @return with type Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\SearchStageExpression is incompatible with native type array\\.$#"
message: "#^PHPDoc tag @return with type mixed is not subtype of native type array\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Search.php

Expand Down Expand Up @@ -470,11 +440,6 @@ parameters:
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Search/SupportsNearOperator.php

-
message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\UnionWith\\:\\:getExpression\\(\\) has invalid return type Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\UnionWithStageExpression\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/UnionWith.php

-
message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\UnionWith\\:\\:getExpression\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
Expand All @@ -486,7 +451,7 @@ parameters:
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/UnionWith.php

-
message: "#^PHPDoc tag @return with type Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\UnionWithStageExpression is incompatible with native type array\\.$#"
message: "#^PHPDoc tag @return with type mixed is not subtype of native type array\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/UnionWith.php

Expand Down Expand Up @@ -531,7 +496,7 @@ parameters:
path: lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php

-
message: "#^Parameter \\#2 \\$options of method Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\ClassMetadata\\<object\\>\\:\\:addIndex\\(\\) expects array\\{background\\?\\: bool, bits\\?\\: int, default_language\\?\\: string, expireAfterSeconds\\?\\: int, language_override\\?\\: string, min\\?\\: float, max\\?\\: float, name\\?\\: string, \\.\\.\\.\\}, array\\<string, non\\-empty\\-array\\<string, array\\<int\\|string, mixed\\>\\|bool\\|float\\|int\\|string\\|null\\>\\|bool\\|float\\|int\\|string\\|null\\> given\\.$#"
message: "#^Parameter \\#2 \\$options of method Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\ClassMetadata\\<object\\>\\:\\:addIndex\\(\\) expects array\\{background\\?\\: bool, bits\\?\\: int, default_language\\?\\: string, expireAfterSeconds\\?\\: int, language_override\\?\\: string, min\\?\\: float, max\\?\\: float, name\\?\\: string, \\.\\.\\.\\}, array\\<string, non\\-empty\\-array\\<string, array\\<int\\<0, max\\>\\|string, mixed\\>\\|bool\\|float\\|int\\|string\\|null\\>\\|bool\\|float\\|int\\|string\\|null\\> given\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php

Expand Down
99 changes: 0 additions & 99 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -288,107 +288,20 @@
<code>new ArrayCollection([$project])</code>
</InvalidArgument>
</file>
<file src="tests/Doctrine/ODM/MongoDB/Tests/Functional/AtomicSetTest.php">
<UndefinedInterfaceMethod>
<code><![CDATA[$malarzm->friends]]></code>
<code><![CDATA[$malarzm->friends]]></code>
<code><![CDATA[$malarzm->friends]]></code>
<code><![CDATA[$malarzm->friends]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->inception]]></code>
<code><![CDATA[$user->phonebooks]]></code>
<code><![CDATA[$user->phonebooks]]></code>
<code><![CDATA[$user->phonebooks]]></code>
<code><![CDATA[$user->phonebooks]]></code>
<code><![CDATA[$user->phonebooks]]></code>
<code><![CDATA[$user->phonebooks]]></code>
<code><![CDATA[$user->phonenumbers]]></code>
<code><![CDATA[$user->phonenumbers]]></code>
<code><![CDATA[$user->phonenumbers]]></code>
<code><![CDATA[$user->phonenumbers]]></code>
<code><![CDATA[$user->phonenumbers]]></code>
<code><![CDATA[$user->phonenumbers]]></code>
<code><![CDATA[$user->phonenumbers]]></code>
<code><![CDATA[$user->phonenumbers]]></code>
<code><![CDATA[$user->phonenumbersArray]]></code>
<code><![CDATA[$user->phonenumbersArray]]></code>
<code><![CDATA[$user->phonenumbersArray]]></code>
<code><![CDATA[$user->phonenumbersArray]]></code>
<code><![CDATA[$user->phonenumbersArray]]></code>
<code>clear</code>
</UndefinedInterfaceMethod>
</file>
<file src="tests/Doctrine/ODM/MongoDB/Tests/Functional/CollectionPersisterTest.php">
<InvalidArgument>
<code><![CDATA[[$user->categories[0]->children, $user->categories[1]->children]]]></code>
<code><![CDATA[[$user->categories[0]->children[0]->children, $user->categories[0]->children[1]->children]]]></code>
<code><![CDATA[[$user->categories[0]->children[0]->children, $user->categories[0]->children[1]->children]]]></code>
</InvalidArgument>
</file>
<file src="tests/Doctrine/ODM/MongoDB/Tests/Functional/CommitImprovementTest.php">
<UndefinedInterfaceMethod>
<code>$phonenumbers</code>
<code>$phonenumbers</code>
</UndefinedInterfaceMethod>
</file>
<file src="tests/Doctrine/ODM/MongoDB/Tests/Functional/CustomCollectionsTest.php">
<InvalidArgument>
<code>$i</code>
<code>$i</code>
<code>$j</code>
<code>$j</code>
</InvalidArgument>
<UndefinedInterfaceMethod>
<code><![CDATA[$d->coll]]></code>
<code><![CDATA[$d->coll]]></code>
</UndefinedInterfaceMethod>
</file>
<file src="tests/Doctrine/ODM/MongoDB/Tests/Functional/DetachedDocumentTest.php">
<UndefinedInterfaceMethod>
Expand Down Expand Up @@ -428,12 +341,6 @@
<code><![CDATA[$doc->embeds]]></code>
</InvalidArgument>
</file>
<file src="tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH1117Test.php">
<UndefinedInterfaceMethod>
<code><![CDATA[$doc->embeds]]></code>
<code><![CDATA[$doc->embeds]]></code>
</UndefinedInterfaceMethod>
</file>
<file src="tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH245Test.php">
<RedundantCondition>
<code>assertIsInt</code>
Expand Down Expand Up @@ -473,12 +380,6 @@
<code>new ArrayCollection([$referenceMany1, $referenceMany2])</code>
</InvalidPropertyAssignmentValue>
</file>
<file src="tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH852Test.php">
<UndefinedInterfaceMethod>
<code><![CDATA[$parent->refMany]]></code>
<code><![CDATA[$parent->refMany]]></code>
</UndefinedInterfaceMethod>
</file>
<file src="tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/MODM29Test.php">
<InvalidArgument>
<code>$collection</code>
Expand Down
5 changes: 3 additions & 2 deletions tests/Doctrine/ODM/MongoDB/Tests/Functional/DateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ public function testDateInstanceValueChangeDoesCauseUpdateIfValueIsTheSame(): vo
$this->dm->clear();

$user = $this->dm->getRepository($user::class)->findOneBy([]);
self::assertInstanceOf(DateTime::class, $user->getCreatedAt());
$user->getCreatedAt()->setTimestamp(time() - 3600);
$createdAt = $user->getCreatedAt();
self::assertInstanceOf(DateTime::class, $createdAt);
$createdAt->setTimestamp(time() - 3600);

$this->dm->getUnitOfWork()->computeChangeSets();
$changeset = $this->dm->getUnitOfWork()->getDocumentChangeSet($user);
Expand Down

0 comments on commit 564b3fb

Please sign in to comment.