Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
required: true

env:
PHP_VERSION: "8.2"
PHP_VERSION: "8.5"
# TODO: change to "stable" once 2.0.0 is released
# DRIVER_VERSION: "stable"
DRIVER_VERSION: "mongodb/mongo-php-driver@v2.x"
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"phpunit/phpunit": "^10.5.35",
"rector/rector": "^2.1.4",
"squizlabs/php_codesniffer": "^3.7",
"vimeo/psalm": "6.5.*"
"vimeo/psalm": "~6.14.2"
},
"replace": {
"mongodb/builder": "*"
Expand Down
17 changes: 10 additions & 7 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="6.5.1@3f17a6b24a2dbe543e21408c2b19108cf6a355ef">
<files psalm-version="6.14.2@bbd217fc98c0daa0a13aea2a7f119d03ba3fc9a0">
<file src="examples/atlas_search.php">
<MixedArgument>
<code><![CDATA[$document['name']]]></code>
Expand All @@ -23,6 +23,11 @@
<code><![CDATA[$document['name']]]></code>
</PossiblyInvalidArrayAccess>
</file>
<file src="examples/gridfs_stream.php">
<ImplicitToStringCast>
<code><![CDATA[$id]]></code>
</ImplicitToStringCast>
</file>
<file src="examples/persistable.php">
<LessSpecificReturnStatement>
<code><![CDATA[(object) [
Expand Down Expand Up @@ -240,6 +245,10 @@
</PossiblyInvalidArgument>
</file>
<file src="src/ClientBulkWrite.php">
<InvalidAttribute>
<code><![CDATA[NoDiscard]]></code>
<code><![CDATA[NoDiscard]]></code>
</InvalidAttribute>
Comment on lines +248 to +251
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Psalm doesn't know this new attribute.

<PossiblyInvalidArgument>
<code><![CDATA[$document]]></code>
<code><![CDATA[$replacement]]></code>
Expand Down Expand Up @@ -388,9 +397,6 @@
<InvalidReturnType>
<code><![CDATA[CursorInterface<TValue>]]></code>
</InvalidReturnType>
<LessSpecificImplementedReturnType>
<code><![CDATA[CursorInterface<TValue>]]></code>
</LessSpecificImplementedReturnType>
<MixedArgument>
<code><![CDATA[$reply->cursor->nextBatch]]></code>
</MixedArgument>
Expand Down Expand Up @@ -559,9 +565,6 @@
<MixedMethodCall>
<code><![CDATA[isInTransaction]]></code>
</MixedMethodCall>
<MixedReturnStatement>
<code><![CDATA[$server->executeBulkWriteCommand($this->bulkWriteCommand, $options)]]></code>
</MixedReturnStatement>
</file>
<file src="src/Operation/Count.php">
<MixedAssignment>
Expand Down
3 changes: 3 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@
<directory name="examples" />
</errorLevel>
</RiskyTruthyFalsyComparison>

<MissingOverrideAttribute errorLevel="suppress" />
<ClassMustBeFinal errorLevel="info" />
</issueHandlers>
</psalm>
1 change: 1 addition & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
use function is_array;
use function is_string;

/** @psalm-no-seal-properties */
class Client implements Stringable
{
public const DEFAULT_URI = 'mongodb://127.0.0.1/';
Expand Down
1 change: 1 addition & 0 deletions src/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
use function is_bool;
use function strlen;

/** @psalm-no-seal-properties */
class Database implements Stringable
{
private const DEFAULT_TYPE_MAP = [
Expand Down
Loading