Skip to content

Commit

Permalink
qa: update psalm configuration and cleanup baseline
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Bösing <[email protected]>
  • Loading branch information
boesing committed Apr 6, 2023
1 parent a2fb57a commit 9626bab
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 22 deletions.
22 changes: 2 additions & 20 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.3.0@b6faa3e96b8eb50ec71384c53799b8a107236bb6">
<files psalm-version="5.4.0@62db5d4f6a7ae0a20f7cc5a4952d730272fc0863">
<file src="src/CallbackStream.php">
<ImplementedReturnTypeMismatch occurrences="1">
<code>null|callable</code>
Expand Down Expand Up @@ -114,10 +114,6 @@
<MoreSpecificImplementedParamType occurrences="1">
<code>$requestTarget</code>
</MoreSpecificImplementedParamType>
<PossiblyNullOperand occurrences="2">
<code>$this-&gt;uri-&gt;getPort()</code>
<code>$uri-&gt;getPort()</code>
</PossiblyNullOperand>
</file>
<file src="src/Response.php">
<DocblockTypeContradiction occurrences="5">
Expand Down Expand Up @@ -170,11 +166,6 @@
<code>$hasContentType</code>
</MixedAssignment>
</file>
<file src="src/Response/JsonResponse.php">
<UnusedFunctionCall occurrences="1">
<code>json_encode</code>
</UnusedFunctionCall>
</file>
<file src="src/Response/RedirectResponse.php">
<DocblockTypeContradiction occurrences="1">
<code>gettype($uri)</code>
Expand Down Expand Up @@ -234,21 +225,12 @@
</RedundantConditionGivenDocblockType>
</file>
<file src="src/ServerRequestFilter/FilterUsingXForwardedHeaders.php">
<ImpureMethodCall occurrences="7">
<ImpureMethodCall occurrences="4">
<code>getHeaderLine</code>
<code>getServerParams</code>
<code>getUri</code>
<code>withHost</code>
<code>withPort</code>
<code>withScheme</code>
<code>withUri</code>
</ImpureMethodCall>
<LessSpecificReturnStatement occurrences="1">
<code>$proxyCIDRList</code>
</LessSpecificReturnStatement>
<MoreSpecificReturnType occurrences="1">
<code>list&lt;non-empty-string&gt;</code>
</MoreSpecificReturnType>
</file>
<file src="src/Stream.php">
<PossiblyNullArgument occurrences="4">
Expand Down
2 changes: 2 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="psalm-baseline.xml"
findUnusedCode="false"
findUnusedPsalmSuppress="true"
>
<projectFiles>
<directory name="src"/>
Expand Down
2 changes: 1 addition & 1 deletion test/StreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ public function testRaisesExceptionOnConstructionForNonStreamResources(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('stream');

/** @psalm-suppress ImplicitToStringCast, PossiblyInvalidArgument */
/** @psalm-suppress PossiblyInvalidArgument */
new Stream($resource);
}

Expand Down
2 changes: 1 addition & 1 deletion test/UriTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function testWithPortReturnsNewInstanceWithProvidedPort($port): void
public function testWithPortReturnsSameInstanceWithProvidedPortIsSameAsBefore(): void
{
$uri = new Uri('https://user:[email protected]:3001/foo?bar=baz#quz');
/** @psalm-suppress PossiblyInvalidArgument,InvalidArgument */
/** @psalm-suppress InvalidArgument */
$new = $uri->withPort('3001');
$this->assertSame($uri, $new);
$this->assertSame(3001, $new->getPort());
Expand Down

0 comments on commit 9626bab

Please sign in to comment.