It seems like $this->getParsedBody() ?? array() can also be of type Koded\Http\Interfaces\Response; however, parameter $data 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
25
$input ??= new Immutable(/** @scrutinizer ignore-type */ $this->getParsedBody() ?? []);
The method count() does not exist on Koded\Stdlib\Data. It seems like you code against a sub-type of said class. However, the method does not exist in Koded\Stdlib\Argument or Koded\Stdlib\Configuration. Are you sure you never get one of those?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
26
if (0 === $input->/** @scrutinizer ignore-call */ count()) {
Loading history...
27
$errors = ['validate' => 'Nothing to validate', 'code' => HttpStatus::BAD_REQUEST];
28
4
return new JsonResponse($errors, HttpStatus::BAD_REQUEST, [
29
1
'Content-Type' => 'application/problem+json'
30
]);
31
}
32
3
if (empty($errors = $validator->validate($input))) {