Skip to content

Commit 0b56ab5

Browse files
committed
Upgrade Psalm to version 6
- Upgrading amphp/amp (v2.6.4 => v3.1.0) - Upgrading amphp/byte-stream (v1.8.2 => v2.1.1) - Locking amphp/parser (v1.1.1) - Locking amphp/pipeline (v1.2.2) - Locking amphp/serialization (v1.0.0) - Locking amphp/sync (v2.3.0) - Upgrading nikic/php-parser (v4.19.4 => v5.4.0) - Upgrading psalm/plugin-phpunit (0.18.4 => 0.19.2) - Locking revolt/event-loop (v1.0.6) - Upgrading vimeo/psalm (5.26.1 => 6.0.0) Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
1 parent 00c8e55 commit 0b56ab5

File tree

2 files changed

+52
-6
lines changed

2 files changed

+52
-6
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
"phpstan/phpstan-phpunit": "^1.4",
3636
"phpstan/phpstan-strict-rules": "^1.6",
3737
"phpunit/phpunit": "^10.0",
38-
"psalm/plugin-phpunit": "^0.18.4",
39-
"vimeo/psalm": "^5.7",
38+
"psalm/plugin-phpunit": "^0.19.2",
39+
"vimeo/psalm": "^6.0",
4040
"zumba/json-serializer": "^3.2"
4141
},
4242
"conflict": {

psalm-baseline.xml

Lines changed: 50 additions & 4 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.0.0@b8e96bb617bf59382113b1b56cef751f648a7dc9">
33
<file src="src/Components/AlterOperation.php">
44
<PossiblyNullReference>
55
<code><![CDATA[has]]></code>
@@ -161,6 +161,9 @@
161161
<PropertyTypeCoercion>
162162
<code><![CDATA[$keywordToken->value]]></code>
163163
</PropertyTypeCoercion>
164+
<RedundantCondition>
165+
<code><![CDATA[$state === 10]]></code>
166+
</RedundantCondition>
164167
<RiskyTruthyFalsyComparison>
165168
<code><![CDATA[! $flags]]></code>
166169
<code><![CDATA[! $flags]]></code>
@@ -876,11 +879,30 @@
876879
<InvalidArrayOffset>
877880
<code><![CDATA[$version[count($version) - 1]]]></code>
878881
</InvalidArrayOffset>
882+
<MixedArgument>
883+
<code><![CDATA[$file]]></code>
884+
<code><![CDATA[$words[$i]]]></code>
885+
</MixedArgument>
879886
<MixedArgumentTypeCoercion>
880887
<code><![CDATA[static function (int $num) use ($type): bool {
881888
return ($type & $num) !== 0;
882889
}]]></code>
883890
</MixedArgumentTypeCoercion>
891+
<MixedArrayAccess>
892+
<code><![CDATA[$file[0]]]></code>
893+
</MixedArrayAccess>
894+
<MixedAssignment>
895+
<code><![CDATA[$file]]></code>
896+
</MixedAssignment>
897+
<MixedOperand>
898+
<code><![CDATA[$file]]></code>
899+
</MixedOperand>
900+
<PossiblyFalseArgument>
901+
<code><![CDATA[file($file)]]></code>
902+
</PossiblyFalseArgument>
903+
<PossiblyFalseIterator>
904+
<code><![CDATA[$files]]></code>
905+
</PossiblyFalseIterator>
884906
</file>
885907
<file src="src/Tools/CustomJsonSerializer.php">
886908
<MixedAssignment>
@@ -898,9 +920,18 @@
898920
</UnusedMethodCall>
899921
</file>
900922
<file src="src/Tools/TestGenerator.php">
923+
<MixedAssignment>
924+
<code><![CDATA[$file]]></code>
925+
</MixedAssignment>
901926
<MixedOperand>
902927
<code><![CDATA[$debug]]></code>
928+
<code><![CDATA[$file]]></code>
929+
<code><![CDATA[$file]]></code>
930+
<code><![CDATA[$file]]></code>
903931
</MixedOperand>
932+
<PossiblyFalseIterator>
933+
<code><![CDATA[$files]]></code>
934+
</PossiblyFalseIterator>
904935
<PossiblyNullArgument>
905936
<code><![CDATA[$debugFile]]></code>
906937
<code><![CDATA[$debugFile]]></code>
@@ -1005,9 +1036,6 @@
10051036
<MixedFunctionCall>
10061037
<code><![CDATA[$func($text)]]></code>
10071038
</MixedFunctionCall>
1008-
<MixedInferredReturnType>
1009-
<code><![CDATA[string]]></code>
1010-
</MixedInferredReturnType>
10111039
<MixedOperand>
10121040
<code><![CDATA[$format['cli']]]></code>
10131041
<code><![CDATA[$format['flags']]]></code>
@@ -1025,6 +1053,12 @@
10251053
<PossiblyInvalidIterator>
10261054
<code><![CDATA[$this->options['formats']]]></code>
10271055
</PossiblyInvalidIterator>
1056+
<PossiblyNullOperand>
1057+
<code><![CDATA[$indent]]></code>
1058+
<code><![CDATA[$indent]]></code>
1059+
<code><![CDATA[$indent]]></code>
1060+
<code><![CDATA[array_pop($blocksLineEndings)]]></code>
1061+
</PossiblyNullOperand>
10281062
<RiskyTruthyFalsyComparison>
10291063
<code><![CDATA[$lineEnded]]></code>
10301064
<code><![CDATA[$this->options['clause_newline']]]></code>
@@ -1190,6 +1224,11 @@
11901224
<code><![CDATA[parameterProvider]]></code>
11911225
</PossiblyUnusedMethod>
11921226
</file>
1227+
<file src="tests/Misc/TranslatorTest.php">
1228+
<PossiblyFalseOperand>
1229+
<code><![CDATA[realpath(__DIR__ . '/../../src/')]]></code>
1230+
</PossiblyFalseOperand>
1231+
</file>
11931232
<file src="tests/Misc/UtfStringTest.php">
11941233
<PossiblyUnusedMethod>
11951234
<code><![CDATA[utf8StringsProvider]]></code>
@@ -1318,6 +1357,13 @@
13181357
* }]]></code>
13191358
</InvalidReturnType>
13201359
</file>
1360+
<file src="tests/Tools/ContextGeneratorTest.php">
1361+
<PossiblyFalseOperand>
1362+
<code><![CDATA[getcwd()]]></code>
1363+
<code><![CDATA[getcwd()]]></code>
1364+
<code><![CDATA[getcwd()]]></code>
1365+
</PossiblyFalseOperand>
1366+
</file>
13211367
<file src="tests/UtfStringSerializer.php">
13221368
<PossiblyUnusedMethod>
13231369
<code><![CDATA[serialize]]></code>

0 commit comments

Comments
 (0)