GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (5)

src/WordpressAuthServiceProvider.php (3 issues)

1
<?php
2
3
namespace MrShan0\WordpressAuth;
4
5
use Auth;
6
use Hautelook\Phpass\PasswordHash;
7
use Illuminate\Support\ServiceProvider;
8
use MrShan0\WordpressAuth\Auth\EloquentWordpressUserProvider;
9
use MrShan0\WordpressAuth\Guard\WordpressGuard;
10
use MrShan0\WordpressAuth\Hashing\WordPressHasher;
11
12
class WordpressAuthServiceProvider extends ServiceProvider
13
{
14
    /**
15
     * Indicates if loading of the provider is deferred.
16
     *
17
     * @var bool
18
     */
19
    protected $defer = false;
20
21
    /**
22
     * Perform post-registration booting of services.
23
     *
24
     * @return void
25
     */
26
    public function boot()
27
    {
28
        $this->publishes([
29
            __DIR__ . '/../config/wordpress-auth.php' => config_path('wordpress-auth.php'),
30
        ]);
31
    }
32
33
    /**
34
     * Register bindings in the container.
35
     *
36
     * @return void
37
     */
38
    public function register()
39
    {
40
        $this->mergeConfigFrom(__DIR__ . '/../config/wordpress-auth.php', 'wordpress-auth');
41
42
        Auth::extend('wordpress', function ($app) {
43
            return new WordpressGuard(
0 ignored issues
show
The call to MrShan0\WordpressAuth\Gu...essGuard::__construct() has too few arguments starting with provider. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

43
            return /** @scrutinizer ignore-call */ new WordpressGuard(

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
44
                new EloquentWordpressUserProvider($app['wordpress-auth'], $config['model'])
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $config seems to be never defined.
Loading history...
new MrShan0\WordpressAut...th'], $config['model']) of type MrShan0\WordpressAuth\Au...ntWordpressUserProvider is incompatible with the type string expected by parameter $name of MrShan0\WordpressAuth\Gu...essGuard::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

44
                /** @scrutinizer ignore-type */ new EloquentWordpressUserProvider($app['wordpress-auth'], $config['model'])
Loading history...
45
            );
46
        });
47
48
        $this->app->singleton('wordpress-auth', function ($app) {
49
            $iteration_count = $app['config']->get('wordpress-auth.hash.iteration_count');
50
            $portable_hashes = $app['config']->get('wordpress-auth.hash.portable_hashes');
51
52
            $hasher = new PasswordHash($iteration_count, $portable_hashes);
53
54
            return new WordPressHasher($hasher);
55
        });
56
57
        Auth::provider('eloquent.wordpress', function ($app, array $config) {
58
            return new EloquentWordpressUserProvider($app['wordpress-auth'], $config['model']);
59
        });
60
    }
61
62
    /**
63
     * Get the services provided by the provider.
64
     *
65
     * @return string[]
66
     */
67
    public function provides()
68
    {
69
        return ['wordpress-auth'];
70
    }
71
}
72