Skip to content

Commit 54cff69

Browse files
Update SA tools (#553)
1 parent 3cf1b6d commit 54cff69

File tree

5 files changed

+77
-94
lines changed

5 files changed

+77
-94
lines changed

phpstan-baseline.neon

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -220,16 +220,6 @@ parameters:
220220
count: 1
221221
path: src/PumpStream.php
222222

223-
-
224-
message: "#^Parameter \\#2 \\$subject of function preg_match expects string, mixed given\\.$#"
225-
count: 1
226-
path: src/Request.php
227-
228-
-
229-
message: "#^Property GuzzleHttp\\\\Psr7\\\\Request\\:\\:\\$requestTarget \\(string\\|null\\) does not accept mixed\\.$#"
230-
count: 1
231-
path: src/Request.php
232-
233223
-
234224
message: "#^Method GuzzleHttp\\\\Psr7\\\\ServerRequest\\:\\:normalizeNestedFileSpec\\(\\) should return array\\<Psr\\\\Http\\\\Message\\\\UploadedFileInterface\\> but returns array\\<int\\|string, array\\<Psr\\\\Http\\\\Message\\\\UploadedFileInterface\\>\\|Psr\\\\Http\\\\Message\\\\UploadedFileInterface\\>\\.$#"
235225
count: 1
@@ -286,7 +276,7 @@ parameters:
286276
path: src/Uri.php
287277

288278
-
289-
message: "#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(int\\|string\\)\\: mixed\\)\\|null, 'urldecode' given\\.$#"
279+
message: "#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(int\\<0, 65535\\>\\|string\\)\\: mixed\\)\\|null, 'urldecode' given\\.$#"
290280
count: 1
291281
path: src/Uri.php
292282

@@ -301,7 +291,7 @@ parameters:
301291
path: src/UriNormalizer.php
302292

303293
-
304-
message: "#^Strict comparison using \\=\\=\\= between '' and non\\-empty\\-string will always evaluate to false\\.$#"
294+
message: "#^Strict comparison using \\=\\=\\= between '' and non\\-falsy\\-string will always evaluate to false\\.$#"
305295
count: 1
306296
path: src/UriResolver.php
307297

psalm-baseline.xml

Lines changed: 71 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,44 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="4.x-dev@">
3-
<file src="src/CachingStream.php">
4-
<UndefinedThisPropertyAssignment occurrences="1">
5-
<code>$this-&gt;stream</code>
6-
</UndefinedThisPropertyAssignment>
7-
</file>
8-
<file src="src/DroppingStream.php">
9-
<UndefinedThisPropertyAssignment occurrences="1">
10-
<code>$this-&gt;stream</code>
11-
</UndefinedThisPropertyAssignment>
12-
</file>
2+
<files psalm-version="5.9.0@8b9ad1eb9e8b7d3101f949291da2b9f7767cd163">
133
<file src="src/FnStream.php">
14-
<InvalidFunctionCall occurrences="15">
15-
<code>call_user_func($this-&gt;_fn___toString)</code>
16-
<code>call_user_func($this-&gt;_fn_close)</code>
17-
<code>call_user_func($this-&gt;_fn_detach)</code>
18-
<code>call_user_func($this-&gt;_fn_eof)</code>
19-
<code>call_user_func($this-&gt;_fn_getContents)</code>
20-
<code>call_user_func($this-&gt;_fn_getMetadata, $key)</code>
21-
<code>call_user_func($this-&gt;_fn_getSize)</code>
22-
<code>call_user_func($this-&gt;_fn_isReadable)</code>
23-
<code>call_user_func($this-&gt;_fn_isSeekable)</code>
24-
<code>call_user_func($this-&gt;_fn_isWritable)</code>
25-
<code>call_user_func($this-&gt;_fn_read, $length)</code>
26-
<code>call_user_func($this-&gt;_fn_rewind)</code>
27-
<code>call_user_func($this-&gt;_fn_seek, $offset, $whence)</code>
28-
<code>call_user_func($this-&gt;_fn_tell)</code>
29-
<code>call_user_func($this-&gt;_fn_write, $string)</code>
4+
<InvalidFunctionCall>
5+
<code><![CDATA[call_user_func($this->_fn___toString)]]></code>
6+
<code><![CDATA[call_user_func($this->_fn_close)]]></code>
7+
<code><![CDATA[call_user_func($this->_fn_detach)]]></code>
8+
<code><![CDATA[call_user_func($this->_fn_eof)]]></code>
9+
<code><![CDATA[call_user_func($this->_fn_getContents)]]></code>
10+
<code><![CDATA[call_user_func($this->_fn_getMetadata, $key)]]></code>
11+
<code><![CDATA[call_user_func($this->_fn_getSize)]]></code>
12+
<code><![CDATA[call_user_func($this->_fn_isReadable)]]></code>
13+
<code><![CDATA[call_user_func($this->_fn_isSeekable)]]></code>
14+
<code><![CDATA[call_user_func($this->_fn_isWritable)]]></code>
15+
<code><![CDATA[call_user_func($this->_fn_read, $length)]]></code>
16+
<code><![CDATA[call_user_func($this->_fn_rewind)]]></code>
17+
<code><![CDATA[call_user_func($this->_fn_seek, $offset, $whence)]]></code>
18+
<code><![CDATA[call_user_func($this->_fn_tell)]]></code>
19+
<code><![CDATA[call_user_func($this->_fn_write, $string)]]></code>
3020
</InvalidFunctionCall>
3121
</file>
22+
<file src="src/Header.php">
23+
<PossiblyUndefinedArrayOffset>
24+
<code>$m[0]</code>
25+
</PossiblyUndefinedArrayOffset>
26+
</file>
3227
<file src="src/HttpFactory.php">
33-
<ParamNameMismatch occurrences="1">
28+
<ParamNameMismatch>
3429
<code>$file</code>
3530
</ParamNameMismatch>
3631
</file>
37-
<file src="src/InflateStream.php">
38-
<UndefinedThisPropertyAssignment occurrences="1">
39-
<code>$this-&gt;stream</code>
40-
</UndefinedThisPropertyAssignment>
41-
</file>
42-
<file src="src/LimitStream.php">
43-
<UndefinedThisPropertyAssignment occurrences="1">
44-
<code>$this-&gt;stream</code>
45-
</UndefinedThisPropertyAssignment>
32+
<file src="src/Message.php">
33+
<PossiblyUndefinedArrayOffset>
34+
<code>$parts[1]</code>
35+
<code>$parts[1]</code>
36+
<code>$parts[1]</code>
37+
<code>$parts[1]</code>
38+
</PossiblyUndefinedArrayOffset>
4639
</file>
4740
<file src="src/MessageTrait.php">
48-
<LessSpecificImplementedReturnType occurrences="7">
41+
<LessSpecificImplementedReturnType>
4942
<code>MessageInterface</code>
5043
<code>MessageInterface</code>
5144
<code>MessageInterface</code>
@@ -54,7 +47,7 @@
5447
<code>array</code>
5548
<code>array</code>
5649
</LessSpecificImplementedReturnType>
57-
<ParamNameMismatch occurrences="6">
50+
<ParamNameMismatch>
5851
<code>$header</code>
5952
<code>$header</code>
6053
<code>$header</code>
@@ -63,75 +56,75 @@
6356
<code>$header</code>
6457
</ParamNameMismatch>
6558
</file>
66-
<file src="src/MultipartStream.php">
67-
<PossiblyNullArgument occurrences="2">
68-
<code>$filename</code>
69-
<code>$filename</code>
70-
</PossiblyNullArgument>
71-
<UndefinedThisPropertyAssignment occurrences="1">
72-
<code>$this-&gt;stream</code>
73-
</UndefinedThisPropertyAssignment>
74-
</file>
7559
<file src="src/Request.php">
76-
<ParadoxicalCondition occurrences="1">
77-
<code>isset($this-&gt;headerNames['host'])</code>
78-
</ParadoxicalCondition>
60+
<NoValue>
61+
<code>$header</code>
62+
</NoValue>
63+
</file>
64+
<file src="src/Response.php">
65+
<RedundantCast>
66+
<code>(int) $code</code>
67+
<code>(string) $reasonPhrase</code>
68+
</RedundantCast>
7969
</file>
8070
<file src="src/ServerRequest.php">
81-
<InvalidReturnStatement occurrences="1">
71+
<InvalidArgument>
72+
<code>$_SERVER['SERVER_PORT']</code>
73+
</InvalidArgument>
74+
<InvalidArrayOffset>
75+
<code>$normalizedFiles[$key]</code>
76+
</InvalidArrayOffset>
77+
<InvalidReturnStatement>
8278
<code>$normalizedFiles</code>
8379
</InvalidReturnStatement>
84-
<InvalidReturnType occurrences="1">
80+
<InvalidReturnType>
8581
<code>UploadedFileInterface[]</code>
8682
</InvalidReturnType>
87-
<ParamNameMismatch occurrences="3">
83+
<ParamNameMismatch>
8884
<code>$attribute</code>
8985
<code>$attribute</code>
9086
<code>$attribute</code>
9187
</ParamNameMismatch>
9288
</file>
9389
<file src="src/Stream.php">
94-
<InvalidPropertyAssignmentValue occurrences="1">
95-
<code>$this-&gt;stream</code>
90+
<InvalidPropertyAssignmentValue>
91+
<code><![CDATA[$this->stream]]></code>
9692
</InvalidPropertyAssignmentValue>
97-
<RedundantPropertyInitializationCheck occurrences="10">
98-
<code>isset($this-&gt;stream)</code>
99-
<code>isset($this-&gt;stream)</code>
100-
<code>isset($this-&gt;stream)</code>
101-
<code>isset($this-&gt;stream)</code>
102-
<code>isset($this-&gt;stream)</code>
103-
<code>isset($this-&gt;stream)</code>
104-
<code>isset($this-&gt;stream)</code>
105-
<code>isset($this-&gt;stream)</code>
106-
<code>isset($this-&gt;stream)</code>
107-
<code>isset($this-&gt;stream)</code>
93+
<RedundantCast>
94+
<code>(int) $whence</code>
95+
</RedundantCast>
96+
<RedundantPropertyInitializationCheck>
97+
<code><![CDATA[isset($this->stream)]]></code>
98+
<code><![CDATA[isset($this->stream)]]></code>
99+
<code><![CDATA[isset($this->stream)]]></code>
100+
<code><![CDATA[isset($this->stream)]]></code>
101+
<code><![CDATA[isset($this->stream)]]></code>
102+
<code><![CDATA[isset($this->stream)]]></code>
103+
<code><![CDATA[isset($this->stream)]]></code>
104+
<code><![CDATA[isset($this->stream)]]></code>
105+
<code><![CDATA[isset($this->stream)]]></code>
106+
<code><![CDATA[isset($this->stream)]]></code>
108107
</RedundantPropertyInitializationCheck>
109108
</file>
110-
<file src="src/StreamDecoratorTrait.php">
111-
<UndefinedThisPropertyAssignment occurrences="2">
112-
<code>$this-&gt;stream</code>
113-
<code>$this-&gt;stream</code>
114-
</UndefinedThisPropertyAssignment>
115-
</file>
116109
<file src="src/Uri.php">
117-
<PossiblyInvalidArgument occurrences="1">
110+
<PossiblyInvalidArgument>
118111
<code>$result</code>
119112
</PossiblyInvalidArgument>
120113
</file>
121114
<file src="src/UriResolver.php">
122-
<TypeDoesNotContainType occurrences="1">
115+
<TypeDoesNotContainType>
123116
<code>'' === $relativePath</code>
124117
</TypeDoesNotContainType>
125118
</file>
126119
<file src="src/Utils.php">
127-
<FalsableReturnStatement occurrences="1">
120+
<FalsableReturnStatement>
128121
<code>$contents</code>
129122
</FalsableReturnStatement>
130-
<MissingDocblockType occurrences="2">
123+
<MissingDocblockType>
131124
<code>throw $ex;</code>
132125
<code>throw $ex;</code>
133126
</MissingDocblockType>
134-
<PossiblyUndefinedVariable occurrences="2">
127+
<PossiblyUndefinedVariable>
135128
<code>$contents</code>
136129
<code>$handle</code>
137130
</PossiblyUndefinedVariable>

vendor-bin/php-cs-fixer/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
33
"php": "^7.4 || ^8.0",
4-
"friendsofphp/php-cs-fixer": "3.10.0"
4+
"friendsofphp/php-cs-fixer": "3.16.0"
55
},
66
"config": {
77
"preferred-install": "dist"

vendor-bin/phpstan/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"require": {
33
"php": "^7.4 || ^8.0",
4-
"phpstan/phpstan": "1.8.2",
5-
"phpstan/phpstan-deprecation-rules": "1.0.0"
4+
"phpstan/phpstan": "1.10.11",
5+
"phpstan/phpstan-deprecation-rules": "1.1.3"
66
},
77
"config": {
88
"preferred-install": "dist"

vendor-bin/psalm/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
33
"php": "^7.4 || ^8.0",
4-
"psalm/phar": "4.26.0"
4+
"psalm/phar": "5.9.0"
55
},
66
"config": {
77
"preferred-install": "dist"

0 commit comments

Comments
 (0)