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
Push — master ( ede4b2...d0189b )
by Atymic
05:37 queued 04:36
created

TwilioConfig::getDebugTo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace NotificationChannels\Twilio;
4
5
class TwilioConfig
6
{
7
    /** @var array */
8
    private $config;
9
10
    /**
11
     * @param array $config
12
     */
13 11
    public function __construct(array $config)
14
    {
15 11
        $this->config = $config;
16 11
    }
17
18
    public function usingUsernamePasswordAuth(): bool
19
    {
20
        return $this->getUsername() !== null && $this->getPassword() !== null && $this->getAccountSid() !== null;
21
    }
22
23
    public function usingTokenAuth(): bool
24
    {
25
        return $this->getAuthToken() !== null && $this->getAccountSid() !== null;
26
    }
27
28
    public function getAuthToken(): ?string
29
    {
30
        return $this->config['auth_token'] ?? null;
31
    }
32
33
    public function getUsername(): ?string
34
    {
35
        return $this->config['username'] ?? null;
36
    }
37
38
    public function getPassword(): ?string
39
    {
40
        return $this->config['password'] ?? null;
41
    }
42
43
    public function getAccountSid(): ?string
44
    {
45
        return $this->config['account_sid'] ?? null;
46
    }
47
48 3
    public function getFrom(): ?string
49
    {
50 3
        return $this->config['from'] ?? null;
51
    }
52
53 1
    public function getAlphanumericSender(): ?string
54
    {
55 1
        return $this->config['alphanumeric_sender'] ?? null;
56
    }
57
58 3
    public function getServiceSid(): ?string
59
    {
60 3
        return $this->config['sms_service_sid'] ?? null;
61
    }
62
63 3
    public function getDebugTo(): ?string
64
    {
65 3
        return $this->config['debug_to'] ?? null;
66
    }
67
68 5
    public function getIgnoredErrorCodes(): array
69
    {
70 5
        return $this->config['ignored_error_codes'] ?? [];
71
    }
72
73 5
    public function isIgnoredErrorCode(int $code): bool
74
    {
75 5
        if (in_array('*', $this->getIgnoredErrorCodes(), true)) {
76 1
            return true;
77
        }
78
79 4
        return in_array($code, $this->getIgnoredErrorCodes(), true);
80
    }
81
}
82