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.

LaravelMnsServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 12
dl 0
loc 45
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A registerConnector() 0 4 1
A register() 0 2 1
A boot() 0 11 2
1
<?php
2
3
/*
4
 * Laravel-Mns -- 阿里云消息队列(MNS)的 Laravel 适配。
5
 *
6
 * This file is part of the milkmeowo/laravel-mns.
7
 *
8
 * (c) Milkmeowo <[email protected]>
9
 * @link: https://github.com/milkmeowo/laravel-queue-aliyun-mns
10
 *
11
 * This source file is subject to the MIT license that is bundled
12
 * with this source code in the file LICENSE.
13
 */
14
15
namespace Milkmeowo\LaravelMns;
16
17
use Illuminate\Support\ServiceProvider;
0 ignored issues
show
Bug introduced by
The type Illuminate\Support\ServiceProvider was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
18
use Milkmeowo\LaravelMns\Connectors\MnsConnector;
19
use Milkmeowo\LaravelMns\Console\MnsFlushCommand;
20
use Milkmeowo\LaravelMns\Console\MnsListQueueCommand;
21
use Milkmeowo\LaravelMns\Console\MnsShowQueueCommand;
22
use Milkmeowo\LaravelMns\Console\MnsCreateQueueCommand;
23
use Milkmeowo\LaravelMns\Console\MnsDeleteQueueCommand;
24
25
class LaravelMnsServiceProvider extends ServiceProvider
26
{
27
    /**
28
     * Indicates if loading of the provider is deferred.
29
     *
30
     * @var bool
31
     */
32
    protected $defer = false;
33
34
    public function boot()
35
    {
36
        $this->registerConnector($this->app['queue']);
37
38
        if ($this->app->runningInConsole()) {
39
            $this->commands([
40
                MnsListQueueCommand::class,
41
                MnsShowQueueCommand::class,
42
                MnsCreateQueueCommand::class,
43
                MnsDeleteQueueCommand::class,
44
                MnsFlushCommand::class,
45
            ]);
46
        }
47
    }
48
49
    /**
50
     * Register the MNS queue connector.
51
     *
52
     * @param \Illuminate\Queue\QueueManager $manager
0 ignored issues
show
Bug introduced by
The type Illuminate\Queue\QueueManager was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
53
     *
54
     * @return void
55
     */
56
    protected function registerConnector($manager)
57
    {
58
        $manager->addConnector('mns', function () {
59
            return new MnsConnector();
60
        });
61
    }
62
63
    /**
64
     * Add the connector to the queue drivers.
65
     *
66
     * @return void
67
     */
68
    public function register()
69
    {
70
    }
71
}
72