Skip to content

Commit 08649c1

Browse files
committed
fix: remove redundant casting operations
Flagged by Psalm. Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
1 parent c1b3f87 commit 08649c1

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

psalm-baseline.xml

Lines changed: 2 additions & 13 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.0.0@4e177bf0c9f03c17d2fbfd83b7cc9c47605274d8">
2+
<files psalm-version="5.2.0@fb685a16df3050d4c18d8a4100fe83abe6458cba">
33
<file src="src/CallbackStream.php">
44
<ImplementedReturnTypeMismatch occurrences="1">
55
<code>null|callable</code>
@@ -512,11 +512,8 @@
512512
<code>$record</code>
513513
<code>$record</code>
514514
</MixedArgumentTypeCoercion>
515-
<MixedAssignment occurrences="4">
516-
<code>$description</code>
515+
<MixedAssignment occurrences="1">
517516
<code>$responseCode</code>
518-
<code>$updated</code>
519-
<code>$value</code>
520517
</MixedAssignment>
521518
<MoreSpecificReturnType occurrences="1">
522519
<code>list&lt;array{numeric-string, non-empty-string}&gt;</code>
@@ -527,11 +524,6 @@
527524
<StringIncrement occurrences="1">
528525
<code>$value</code>
529526
</StringIncrement>
530-
<UndefinedPropertyFetch occurrences="3">
531-
<code>$descriptionQueryResult-&gt;item(0)?-&gt;nodeValue</code>
532-
<code>$updatedQueryResult-&gt;item(0)?-&gt;nodeValue</code>
533-
<code>$valueQueryResult-&gt;item(0)?-&gt;nodeValue</code>
534-
</UndefinedPropertyFetch>
535527
</file>
536528
<file src="test/ServerRequestFactoryTest.php">
537529
<InvalidArgument occurrences="1">
@@ -550,9 +542,6 @@
550542
<InvalidArgument occurrences="1">
551543
<code>$resource</code>
552544
</InvalidArgument>
553-
<UndefinedDocblockClass occurrences="1">
554-
<code>CurlHandle|GdImage|false|resource</code>
555-
</UndefinedDocblockClass>
556545
</file>
557546
<file src="test/UploadedFileTest.php">
558547
<MixedArgument occurrences="2">

test/ResponseTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ private function fetchIanaStatusCodes(): DOMDocument
8383
$updatedQueryResult = $xpath->query('//ns:updated');
8484
if ($updatedQueryResult !== false && $updatedQueryResult->length > 0) {
8585
$updated = $updatedQueryResult->item(0)?->nodeValue ?: '';
86-
$updated = strtotime((string) $updated);
86+
$updated = strtotime($updated);
8787
}
8888
}
8989

@@ -149,8 +149,8 @@ public function ianaCodesReasonPhrasesProvider(): array
149149
continue;
150150
}
151151

152-
$value = (string) $value;
153-
$description = (string) $description;
152+
$value = $value;
153+
$description = $description;
154154

155155
if (preg_match('/^([0-9]+)\s*\-\s*([0-9]+)$/', $value, $matches)) {
156156
for ($value = $matches[1]; $value <= $matches[2]; $value++) {

0 commit comments

Comments
 (0)