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.
Completed
Pull Request — master (#86)
by
unknown
02:19
created

TwilioConfig   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 105
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 60.87%

Importance

Changes 0
Metric Value
wmc 11
lcom 1
cbo 1
dl 0
loc 105
ccs 14
cts 23
cp 0.6087
rs 10
c 0
b 0
f 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getAuthToken() 0 4 1
A getUsername() 0 4 1
A getPassword() 0 4 1
A getAccountSid() 0 4 1
A getFrom() 0 4 1
A getAlphanumericSender() 0 8 2
A getServiceSid() 0 8 2
A getTo() 0 4 1
1
<?php
2
3
namespace NotificationChannels\Twilio;
4
5
use Illuminate\Support\Arr;
6
7
class TwilioConfig
8
{
9
    /**
10
     * @var array
11
     */
12
    private $config;
13
14
    /**
15
     * TwilioConfig constructor.
16
     *
17
     * @param array $config
18
     */
19 4
    public function __construct(array $config)
20
    {
21 4
        $this->config = $config;
22 4
    }
23
24
    /**
25
     * Get the auth token.
26
     *
27
     * @return string
28
     */
29
    public function getAuthToken()
30
    {
31
        return $this->config['auth_token'];
32
    }
33
34
    /**
35
     * Get the username.
36
     *
37
     * @return string
38
     */
39
    public function getUsername()
40
    {
41
        return $this->config['username'];
42
    }
43
44
    /**
45
     * Get the password.
46
     *
47
     * @return string
48
     */
49
    public function getPassword()
50
    {
51
        return $this->config['password'];
52
    }
53
54
    /**
55
     * Get the account sid.
56
     *
57
     * @return string
58
     */
59
    public function getAccountSid()
60
    {
61
        return $this->config['account_sid'];
62
    }
63
64
    /**
65
     * Get the default from address.
66
     *
67
     * @return string
68
     */
69 3
    public function getFrom()
70
    {
71 3
        return $this->config['from'];
72
    }
73
74
    /**
75
     * Get the alphanumeric sender.
76
     *
77
     * @return string|null
78
     */
79 1
    public function getAlphanumericSender()
80
    {
81 1
        if (isset($this->config['alphanumeric_sender'])) {
82 1
            return $this->config['alphanumeric_sender'];
83
        }
84
85
        return null;
86
    }
87
88
    /**
89
     * Get the service sid.
90
     *
91
     * @return string|null
92
     */
93 3
    public function getServiceSid()
94
    {
95 3
        if (isset($this->config['sms_service_sid'])) {
96 1
            return $this->config['sms_service_sid'];
97
        }
98
99 2
        return null;
100
    }
101
102
    /**
103
     * Returns universal phone number, which should receive all outgoing messages and calls.
104
     *
105
     * @return string|null
106
     */
107 4
    public function getTo()
108
    {
109 4
        return Arr::get($this->config, 'to');
110
    }
111
}
112