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
$input = new Immutable(/** @scrutinizer ignore-type */ $this->getParsedBody() ?? []);
Loading history...
27
if (0 === $input->count()) {
28
4
$errors = ['validate' => 'Nothing to validate', 'code' => StatusCode::BAD_REQUEST];
29
1
return new ServerResponse(json_serialize($errors), StatusCode::BAD_REQUEST);
30
}
31
if (empty($errors = $validator->validate($input))) {