It seems like Illuminate\Support\Facad...er($config['provider']) can also be of type null; however, parameter $provider of Napp\Core\Api\Auth\ApiGuard::__construct() does only seem to accept Illuminate\Contracts\Auth\UserProvider, 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
19
return new ApiGuard(/** @scrutinizer ignore-type */ Auth::createUserProvider($config['provider']), $app['request'], $app['config']->get('api-core.api-key'));