It seems like $transformer defined by parameter $transformer on line 22 can be null; however, League\Fractal\TransformerAbstract::item() does not accept null, maybe add an additional type check?
It seems like you allow that null is being passed for a parameter, however the
function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):
functionnotNullable(stdClass$x){}// UnsafefunctionwithoutCheck(stdClass$x=null){notNullable($x);}// Safe - Alternative 1: Adding Additional Type-CheckfunctionwithCheck(stdClass$x=null){if($xinstanceofstdClass){notNullable($x);}}// Safe - Alternative 2: Changing ParameterfunctionwithNonNullableParam(stdClass$x){notNullable($x);}
Loading history...
27
->toArray();
28
}
29
30
/**
31
* @param mixed $data
32
* @param AbstractTransformer $transformer
33
*
34
* @return array
35
*/
36
protected function loadCollection($data = null, AbstractTransformer $transformer = null)
It seems like $transformer defined by parameter $transformer on line 36 can be null; however, League\Fractal\TransformerAbstract::collection() does not accept null, maybe add an additional type check?
It seems like you allow that null is being passed for a parameter, however the
function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):
functionnotNullable(stdClass$x){}// UnsafefunctionwithoutCheck(stdClass$x=null){notNullable($x);}// Safe - Alternative 1: Adding Additional Type-CheckfunctionwithCheck(stdClass$x=null){if($xinstanceofstdClass){notNullable($x);}}// Safe - Alternative 2: Changing ParameterfunctionwithNonNullableParam(stdClass$x){notNullable($x);}
It seems like you allow that null is being passed for a parameter, however the function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):