Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.2] Fix builds #2319

Merged
merged 4 commits into from
Jun 2, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update baselines for phpstan and psalm
  • Loading branch information
alcaeus committed Jun 1, 2021
commit 5e9470450d73b3fccabdcd4f3165c954609d4780
61 changes: 39 additions & 22 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,27 +1,44 @@
parameters:
ignoreErrors:
# Adding a parameter would be BC-break
-
message: "#^PHPDoc tag @param references unknown parameter\\: \\$applyFilters$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php
ignoreErrors:
# Adding a parameter would be BC-break
-
message: "#^PHPDoc tag @param references unknown parameter\\: \\$applyFilters$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php

# Making classes final as suggested would be a BC-break
-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
paths:
- lib/Doctrine/ODM/MongoDB/Aggregation/Expr.php
- lib/Doctrine/ODM/MongoDB/DocumentManager.php
# Making classes final as suggested would be a BC-break
-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Expr.php

# The limit option in GeoNear has been removed in MongoDB 4.2 in favor of $limit stage
-
message: "#^Return type \\(Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\GeoNear\\) of method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\GeoNear\\:\\:limit\\(\\) should be compatible with return type \\(Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Limit\\) of method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\:\\:limit\\(\\)$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GeoNear.php
# The limit option in GeoNear has been removed in MongoDB 4.2 in favor of $limit stage
-
message: "#^Return type \\(Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\GeoNear\\) of method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\GeoNear\\:\\:limit\\(\\) should be compatible with return type \\(Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Limit\\) of method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\:\\:limit\\(\\)$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GeoNear.php

# Union types cannot be added yet
-
message: "#^Result of && is always false\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Query/Builder.php
# Fixed in 2.3
-
message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:find\\(\\) should return T of object\\|null but returns object\\|null\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/DocumentManager.php

# Fixed in 2.3
-
message: "#^Return type \\(Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\ClassMetadataFactory\\) of method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:getMetadataFactory\\(\\) should be compatible with return type \\(Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadataFactory\\<Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\<object\\>\\>\\) of method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getMetadataFactory\\(\\)$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/DocumentManager.php

# Making classes final as suggested would be a BC-break
-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/DocumentManager.php

# Union types cannot be added yet
-
message: "#^Result of && is always false\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Query/Builder.php

31 changes: 31 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.7.3@38c452ae584467e939d55377aaf83b5a26f19dd1">
<file src="lib/Doctrine/ODM/MongoDB/DocumentManager.php">
<ParamNameMismatch occurrences="8">
<code>$document</code>
<code>$document</code>
<code>$document</code>
<code>$document</code>
<code>$document</code>
<code>$document</code>
<code>$documentName</code>
<code>$documentName</code>
</ParamNameMismatch>
</file>
<file src="lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php">
<ParamNameMismatch occurrences="2">
<code>$fieldName</code>
<code>$fieldName</code>
</ParamNameMismatch>
</file>
<file src="lib/Doctrine/ODM/MongoDB/PersistentCollection/PersistentCollectionTrait.php">
<ParamNameMismatch occurrences="1">
<code>$value</code>
</ParamNameMismatch>
</file>
<file src="lib/Doctrine/ODM/MongoDB/Query/QueryExpressionVisitor.php">
<ParamNameMismatch occurrences="1">
<code>$compositeExpr</code>
</ParamNameMismatch>
</file>
</files>
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="psalm-baseline.xml"
>
<projectFiles>
<directory name="lib/Doctrine/ODM/MongoDB" />
Expand Down