$parameter is of type Illuminate\Http\Request, but the property $request was declared to be of type Sarala\Http\Requests\ApiRequestAbstract. Are you sure that you always receive this specific sub-class here, or does it make sense to add an instanceof check?
Our type inference engine has found a suspicous assignment of a value to a property.
This check raises an issue when a value that can be of a given class or a super-class
is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.
The method includes() does not exist on Sarala\Http\Requests\ApiRequestAbstract. Since you implemented __call, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
38
$this->request->/** @scrutinizer ignore-call */
39
includes()->each(function ($params, $field) {
Loading history...
39
if (! $this->isIncludeAllowed($field)) {
40
throw new UnauthorizedIncludeException($field, $this->request->allowedIncludes());
41
}
42
});
43
}
44
45
private function isIncludeAllowed($field): bool
46
{
47
foreach ($this->request->allowedIncludes() as $allowedInclude) {
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.