Skip to content

Commit 910a68f

Browse files
authored
PHPLIB-1612 Upgrade Psalm v6 (#1576)
1 parent c129a46 commit 910a68f

File tree

7 files changed

+5
-147
lines changed

7 files changed

+5
-147
lines changed

.github/actions/setup/action.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,5 @@ runs:
4949
- name: Install dependencies with Composer
5050
uses: ramsey/composer-install@3.0.0
5151
with:
52-
# Revert when psalm supports PHP 8.4
53-
# composer-options: "--no-suggest"
54-
composer-options: "--no-suggest ${{ inputs.php-version == '8.4' && '--ignore-platform-req=php+' || '' }}"
52+
composer-options: "--no-suggest"
5553
working-directory: "${{ inputs.working-directory }}"

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"phpunit/phpunit": "^10.5.35",
2525
"rector/rector": "^1.2",
2626
"squizlabs/php_codesniffer": "^3.7",
27-
"vimeo/psalm": "^5.13"
27+
"vimeo/psalm": "^6.5"
2828
},
2929
"replace": {
3030
"mongodb/builder": "*"

psalm-baseline.xml

Lines changed: 1 addition & 19 deletions
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.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
2+
<files psalm-version="6.5.1@3f17a6b24a2dbe543e21408c2b19108cf6a355ef">
33
<file src="examples/atlas_search.php">
44
<MixedArgument>
55
<code><![CDATA[$document['name']]]></code>
@@ -398,11 +398,6 @@
398398
<code><![CDATA[$this->current()]]></code>
399399
</PossiblyNullArgument>
400400
</file>
401-
<file src="src/Model/CodecCursor.php">
402-
<TooManyArguments>
403-
<code><![CDATA[getId]]></code>
404-
</TooManyArguments>
405-
</file>
406401
<file src="src/Model/CollectionInfoCommandIterator.php">
407402
<DeprecatedInterface>
408403
<code><![CDATA[CollectionInfoCommandIterator]]></code>
@@ -754,9 +749,6 @@
754749
<code><![CDATA[$options['writeConcern']]]></code>
755750
<code><![CDATA[$value]]></code>
756751
</MixedAssignment>
757-
<MixedInferredReturnType>
758-
<code><![CDATA[array|object|null]]></code>
759-
</MixedInferredReturnType>
760752
<MixedMethodCall>
761753
<code><![CDATA[decode]]></code>
762754
<code><![CDATA[isInTransaction]]></code>
@@ -772,9 +764,6 @@
772764
<MixedAssignment>
773765
<code><![CDATA[$document]]></code>
774766
</MixedAssignment>
775-
<MixedInferredReturnType>
776-
<code><![CDATA[array|object|null]]></code>
777-
</MixedInferredReturnType>
778767
<MixedReturnStatement>
779768
<code><![CDATA[$document === false ? null : $document]]></code>
780769
<code><![CDATA[$document === false ? null : $document]]></code>
@@ -922,9 +911,6 @@
922911
<MixedAssignment>
923912
<code><![CDATA[$this->postBatchResumeToken]]></code>
924913
</MixedAssignment>
925-
<MixedInferredReturnType>
926-
<code><![CDATA[array|object|null]]></code>
927-
</MixedInferredReturnType>
928914
<MixedPropertyFetch>
929915
<code><![CDATA[$reply->cursor->firstBatch]]></code>
930916
<code><![CDATA[$reply->cursor->postBatchResumeToken]]></code>
@@ -963,10 +949,6 @@
963949
<code><![CDATA[$typeMap['fieldPaths'][$fieldPath]]]></code>
964950
<code><![CDATA[$value]]></code>
965951
</MixedAssignment>
966-
<MixedInferredReturnType>
967-
<code><![CDATA[array|object|null]]></code>
968-
<code><![CDATA[array|object|null]]></code>
969-
</MixedInferredReturnType>
970952
<MixedReturnStatement>
971953
<code><![CDATA[$collectionInfo['options']['encryptedFields'] ?? null]]></code>
972954
<code><![CDATA[$collectionInfo['options']['encryptedFields'] ?? null]]></code>

psalm.xml.dist

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<psalm
33
errorLevel="1"
44
errorBaseline="psalm-baseline.xml"
5+
ignoreInternalFunctionFalseReturn="true"
6+
ignoreInternalFunctionNullReturn="true"
57
resolveFromConfigFile="true"
68
findUnusedBaselineEntry="true"
79
findUnusedCode="false"
@@ -17,12 +19,6 @@
1719
</ignoreFiles>
1820
</projectFiles>
1921

20-
<stubs>
21-
<file name="stubs/BSON/Document.stub.php"/>
22-
<file name="stubs/BSON/Iterator.stub.php"/>
23-
<file name="stubs/BSON/PackedArray.stub.php"/>
24-
</stubs>
25-
2622
<issueHandlers>
2723
<!-- Class is meant to be Unserialized by the extension only -->
2824
<PropertyNotSetInConstructor>

stubs/BSON/Document.stub.php

Lines changed: 0 additions & 49 deletions
This file was deleted.

stubs/BSON/Iterator.stub.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

stubs/BSON/PackedArray.stub.php

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)