Skip to content

Commit d5c5d04

Browse files
committed
Optimized code for phpstan.neon
1 parent 289bdda commit d5c5d04

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

src/AssertableJsonString.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,6 @@ public function assertMissingExact(array $data)
215215
'within' . PHP_EOL . PHP_EOL .
216216
"[{$actual}]."
217217
);
218-
219-
return $this;
220218
}
221219

222220
/**

src/Constraint/ArraySubset.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,6 @@ protected function failureDescription($other): string
121121
*/
122122
private function toArray(iterable $other): array
123123
{
124-
if (is_array($other)) {
125-
return $other;
126-
}
127-
128124
if ($other instanceof ArrayObject) {
129125
return $other->getArrayCopy();
130126
}
@@ -133,7 +129,6 @@ private function toArray(iterable $other): array
133129
return iterator_to_array($other);
134130
}
135131

136-
// Keep BC even if we know that array would not be the expected one
137132
return (array) $other;
138133
}
139134
}

src/Http/TestResponse.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class TestResponse implements ArrayAccess
4141
/**
4242
* The streamed content of the response.
4343
*
44-
* @var string
44+
* @var null|string
4545
*/
4646
protected $streamedContent;
4747

@@ -675,7 +675,7 @@ public function getStatusCode(): int
675675
*/
676676
public function streamedContent()
677677
{
678-
if (! is_null($this->streamedContent)) { /* @phpstan-ignore-line */
678+
if (! is_null($this->streamedContent)) {
679679
return $this->streamedContent;
680680
}
681681

@@ -693,7 +693,7 @@ public function streamedContent()
693693

694694
ob_end_clean();
695695

696-
return $this->streamedContent;
696+
return (string) $this->streamedContent;
697697
}
698698

699699
/**

0 commit comments

Comments
 (0)