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.
Passed
Push — master ( fbbdbd...789991 )
by Šimon
02:05
created

SmsMessage   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 68
rs 10
c 0
b 0
f 0
ccs 21
cts 21
cp 1
wmc 8

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getMessage() 0 3 1
A getSender() 0 3 1
A getRequestType() 0 3 1
A getCustomId() 0 3 1
A __construct() 0 20 3
A getRecipients() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimPod\SmsManager;
6
7
use SimPod\SmsManager\Exception\NoRecipientsProvided;
8
use function count;
9
10
class SmsMessage
11
{
12
    /** @var string */
13
    protected $message;
14
15
    /** @var RequestType */
16
    protected $requestType;
17
18
    /** @var string[] */
19
    protected $recipients = [];
20
21
    /** @var string|null */
22
    protected $sender;
23
24
    /** @var int|null */
25
    protected $customId;
26
27
    /**
28
     * @param string[] $recipients
29
     */
30 3
    public function __construct(
31
        string $message,
32
        array $recipients,
33
        ?RequestType $requestTypeHigh = null,
34
        ?string $sender = null,
35
        ?int $customId = null
36
    ) {
37 3
        if (count($recipients) === 0) {
38 1
            throw new NoRecipientsProvided();
39
        }
40
41 2
        $this->message = $message;
42
43 2
        if ($requestTypeHigh === null) {
44 1
            $requestTypeHigh = RequestType::getRequestTypeHigh();
45
        }
46 2
        $this->requestType = $requestTypeHigh;
47 2
        $this->sender      = $sender;
48 2
        $this->customId    = $customId;
49 2
        $this->recipients  = $recipients;
50 2
    }
51
52 2
    public function getMessage() : string
53
    {
54 2
        return $this->message;
55
    }
56
57 2
    public function getRequestType() : RequestType
58
    {
59 2
        return $this->requestType;
60
    }
61
62
    /**
63
     * @return string[]
64
     */
65 2
    public function getRecipients() : array
66
    {
67 2
        return $this->recipients;
68
    }
69
70 2
    public function getSender() : ?string
71
    {
72 2
        return $this->sender;
73
    }
74
75 2
    public function getCustomId() : ?int
76
    {
77 2
        return $this->customId;
78
    }
79
}
80