It seems like $this->getParsedBody() ?? array() can also be of type Koded\Http\Interfaces\Response; however, parameter $values of Koded\Stdlib\Immutable::__construct() does only seem to accept array, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
26
$body = new Immutable(/** @scrutinizer ignore-type */ $this->getParsedBody() ?? []);
Loading history...
27
28
4
if (0 === $body->count()) {
29
1
return null;
30
}
31
32
3
if (empty($errors = $validator->validate($body))) {