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 ( c2c652...2f2291 )
by Lester
04:10
created

SendHttpApiParams::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 4
1
<?php
2
3
namespace LBHurtado\EngageSpark\Classes;
4
5
use LBHurtado\Common\Contracts\HttpApiParams;
6
7
class SendHttpApiParams implements HttpApiParams
8
{
9
    /**
10
     * @var int
11
     */
12
    protected $org_id;
13
14
    /**
15
     * @var string
16
     */
17
    protected $mobile_number;
18
19
    /**
20
     * @var string
21
     */
22
    protected $message;
23
24
    /**
25
     * @var string
26
     */
27
    protected $sender_id;
28
29
    /**
30
     * @var string
31
     */
32
    protected $recipientType = 'mobile_number';
33
34
    /**
35
     * SendParams constructor.
36
     * @param $org_id
37
     * @param $mobile_number
38
     * @param $message
39
     * @param $sender_id
40
     */
41
    public function __construct(int $org_id, string $mobile_number, string $message, string $sender_id = null)
42
    {
43
        $this->org_id = $org_id;
44
        $this->mobile_number = $mobile_number;
45
        $this->message = $message;
46
        $this->sender_id = $sender_id; //TODO: read ENGAGESPARK_SENDER_ID from .env
47
    }
48
49
    public function setRecipientType(string $recipientType)
50
    {
51
        $this->recipientType = $recipientType;
52
53
        return $this;
54
    }
55
56
    public function toArray(): array
57
    {
58
        return [
59
            'organization_id' => $this->org_id,
60
            'mobile_numbers' => [$this->mobile_number],
61
            'message' => $this->message,
62
            'sender_id' => $this->sender_id,
63
            'recipient_type'  => $this->recipientType,
64
        ];
65
    }
66
}
67