Skip to content

Commit

Permalink
PHPLIB-1612 Upgrade Psalm v6 (#1576)
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN authored Feb 11, 2025
1 parent c129a46 commit 910a68f
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 147 deletions.
4 changes: 1 addition & 3 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,5 @@ runs:
- name: Install dependencies with Composer
uses: ramsey/[email protected]
with:
# Revert when psalm supports PHP 8.4
# composer-options: "--no-suggest"
composer-options: "--no-suggest ${{ inputs.php-version == '8.4' && '--ignore-platform-req=php+' || '' }}"
composer-options: "--no-suggest"
working-directory: "${{ inputs.working-directory }}"
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"phpunit/phpunit": "^10.5.35",
"rector/rector": "^1.2",
"squizlabs/php_codesniffer": "^3.7",
"vimeo/psalm": "^5.13"
"vimeo/psalm": "^6.5"
},
"replace": {
"mongodb/builder": "*"
Expand Down
20 changes: 1 addition & 19 deletions 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.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
<files psalm-version="6.5.1@3f17a6b24a2dbe543e21408c2b19108cf6a355ef">
<file src="examples/atlas_search.php">
<MixedArgument>
<code><![CDATA[$document['name']]]></code>
Expand Down Expand Up @@ -398,11 +398,6 @@
<code><![CDATA[$this->current()]]></code>
</PossiblyNullArgument>
</file>
<file src="src/Model/CodecCursor.php">
<TooManyArguments>
<code><![CDATA[getId]]></code>
</TooManyArguments>
</file>
<file src="src/Model/CollectionInfoCommandIterator.php">
<DeprecatedInterface>
<code><![CDATA[CollectionInfoCommandIterator]]></code>
Expand Down Expand Up @@ -754,9 +749,6 @@
<code><![CDATA[$options['writeConcern']]]></code>
<code><![CDATA[$value]]></code>
</MixedAssignment>
<MixedInferredReturnType>
<code><![CDATA[array|object|null]]></code>
</MixedInferredReturnType>
<MixedMethodCall>
<code><![CDATA[decode]]></code>
<code><![CDATA[isInTransaction]]></code>
Expand All @@ -772,9 +764,6 @@
<MixedAssignment>
<code><![CDATA[$document]]></code>
</MixedAssignment>
<MixedInferredReturnType>
<code><![CDATA[array|object|null]]></code>
</MixedInferredReturnType>
<MixedReturnStatement>
<code><![CDATA[$document === false ? null : $document]]></code>
<code><![CDATA[$document === false ? null : $document]]></code>
Expand Down Expand Up @@ -922,9 +911,6 @@
<MixedAssignment>
<code><![CDATA[$this->postBatchResumeToken]]></code>
</MixedAssignment>
<MixedInferredReturnType>
<code><![CDATA[array|object|null]]></code>
</MixedInferredReturnType>
<MixedPropertyFetch>
<code><![CDATA[$reply->cursor->firstBatch]]></code>
<code><![CDATA[$reply->cursor->postBatchResumeToken]]></code>
Expand Down Expand Up @@ -963,10 +949,6 @@
<code><![CDATA[$typeMap['fieldPaths'][$fieldPath]]]></code>
<code><![CDATA[$value]]></code>
</MixedAssignment>
<MixedInferredReturnType>
<code><![CDATA[array|object|null]]></code>
<code><![CDATA[array|object|null]]></code>
</MixedInferredReturnType>
<MixedReturnStatement>
<code><![CDATA[$collectionInfo['options']['encryptedFields'] ?? null]]></code>
<code><![CDATA[$collectionInfo['options']['encryptedFields'] ?? null]]></code>
Expand Down
8 changes: 2 additions & 6 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<psalm
errorLevel="1"
errorBaseline="psalm-baseline.xml"
ignoreInternalFunctionFalseReturn="true"
ignoreInternalFunctionNullReturn="true"
resolveFromConfigFile="true"
findUnusedBaselineEntry="true"
findUnusedCode="false"
Expand All @@ -17,12 +19,6 @@
</ignoreFiles>
</projectFiles>

<stubs>
<file name="stubs/BSON/Document.stub.php"/>
<file name="stubs/BSON/Iterator.stub.php"/>
<file name="stubs/BSON/PackedArray.stub.php"/>
</stubs>

<issueHandlers>
<!-- Class is meant to be Unserialized by the extension only -->
<PropertyNotSetInConstructor>
Expand Down
49 changes: 0 additions & 49 deletions stubs/BSON/Document.stub.php

This file was deleted.

29 changes: 0 additions & 29 deletions stubs/BSON/Iterator.stub.php

This file was deleted.

40 changes: 0 additions & 40 deletions stubs/BSON/PackedArray.stub.php

This file was deleted.

0 comments on commit 910a68f

Please sign in to comment.