Skip to content

Commit

Permalink
fix: remove redundant casting operations
Browse files Browse the repository at this point in the history
Flagged by Psalm.

Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
  • Loading branch information
weierophinney committed Dec 14, 2022
1 parent c1b3f87 commit 08649c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
15 changes: 2 additions & 13 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.0.0@4e177bf0c9f03c17d2fbfd83b7cc9c47605274d8">
<files psalm-version="5.2.0@fb685a16df3050d4c18d8a4100fe83abe6458cba">
<file src="src/CallbackStream.php">
<ImplementedReturnTypeMismatch occurrences="1">
<code>null|callable</code>
Expand Down Expand Up @@ -512,11 +512,8 @@
<code>$record</code>
<code>$record</code>
</MixedArgumentTypeCoercion>
<MixedAssignment occurrences="4">
<code>$description</code>
<MixedAssignment occurrences="1">
<code>$responseCode</code>
<code>$updated</code>
<code>$value</code>
</MixedAssignment>
<MoreSpecificReturnType occurrences="1">
<code>list&lt;array{numeric-string, non-empty-string}&gt;</code>
Expand All @@ -527,11 +524,6 @@
<StringIncrement occurrences="1">
<code>$value</code>
</StringIncrement>
<UndefinedPropertyFetch occurrences="3">
<code>$descriptionQueryResult-&gt;item(0)?-&gt;nodeValue</code>
<code>$updatedQueryResult-&gt;item(0)?-&gt;nodeValue</code>
<code>$valueQueryResult-&gt;item(0)?-&gt;nodeValue</code>
</UndefinedPropertyFetch>
</file>
<file src="test/ServerRequestFactoryTest.php">
<InvalidArgument occurrences="1">
Expand All @@ -550,9 +542,6 @@
<InvalidArgument occurrences="1">
<code>$resource</code>
</InvalidArgument>
<UndefinedDocblockClass occurrences="1">
<code>CurlHandle|GdImage|false|resource</code>
</UndefinedDocblockClass>
</file>
<file src="test/UploadedFileTest.php">
<MixedArgument occurrences="2">
Expand Down
6 changes: 3 additions & 3 deletions test/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private function fetchIanaStatusCodes(): DOMDocument
$updatedQueryResult = $xpath->query('//ns:updated');
if ($updatedQueryResult !== false && $updatedQueryResult->length > 0) {
$updated = $updatedQueryResult->item(0)?->nodeValue ?: '';
$updated = strtotime((string) $updated);
$updated = strtotime($updated);
}
}

Expand Down Expand Up @@ -149,8 +149,8 @@ public function ianaCodesReasonPhrasesProvider(): array
continue;
}

$value = (string) $value;
$description = (string) $description;
$value = $value;
$description = $description;

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

0 comments on commit 08649c1

Please sign in to comment.