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.

MnsConnector   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 21
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A connect() 0 11 1
1
<?php
2
3
/*
4
 * Laravel-Mns -- 阿里云消息队列(MNS)的 Laravel 适配。
5
 *
6
 * This file is part of the abe/laravel-mns.
7
 *
8
 * (c) Abraham Greyson <[email protected]>
9
 * @link: https://github.com/abrahamgreyson/laravel-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 LaravelMns\Connectors;
16
17
use AliyunMNS\Client as MnsClient;
18
use Config;
19
use Illuminate\Queue\Connectors\ConnectorInterface;
20
use LaravelMns\MnsAdapter;
21
use LaravelMns\MnsQueue;
22
23
/**
24
 * Class MnsConnector.
25
 *
26
 * @codeCoverageIgnore
27
 */
28
class MnsConnector implements ConnectorInterface
29
{
30
    /**
31
     * Establish a queue connection.
32
     *
33
     * @param array $config
34
     *
35
     * @return \Illuminate\Contracts\Queue\Queue
36
     */
37
    public function connect(array $config)
38
    {
39
        $config = Config::get('queue.connections.mns');
40
41
        return new MnsQueue(
42
            new MnsAdapter(
43
                new MnsClient($config['endpoint'], $config['key'], $config['secret']),
44
                $config['queue']
45
            )
46
        );
47
    }
48
}
49