Completed
Push — master ( efd685...083a97 )
by Mads
04:24 queued 11s
created

src/Auth/AuthServiceProvider.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Napp\Core\Api\Auth;
4
5
use Illuminate\Support\Facades\Auth;
6
use Illuminate\Support\ServiceProvider;
7
8
/**
9
 * Class AuthServiceProvider.
10
 */
11
class AuthServiceProvider extends ServiceProvider
12
{
13
    /**
14
     * @return void
15
     */
16
    public function register()
17
    {
18
        Auth::extend('api', function ($app, $name, array $config) {
19
            return new ApiGuard(Auth::createUserProvider($config['provider']), $app['request']);
0 ignored issues
show
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']);
Loading history...
20
        });
21
    }
22
}
23