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 ( 0b7240...e9bac1 )
by Lester
06:02
created

SendHttpApiParams::setRecipientType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace LBHurtado\EngageSpark\Classes;
4
5
use Illuminate\Support\Arr;
6
use LBHurtado\EngageSpark\EngageSpark;
7
use LBHurtado\Common\Contracts\HttpApiParams;
8
9 View Code Duplication
class SendHttpApiParams implements HttpApiParams
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
{
11
    /**
12
     * @var EngageSpark
13
     */
14
    protected $service;
15
16
    /**
17
     * @var string
18
     */
19
    protected $mobile;
20
21
    /**
22
     * @var string
23
     */
24
    protected $message;
25
26
    /**
27
     * @var string
28
     */
29
    protected $recipientType = 'mobile_number';
30
31
    /**
32
     * SendParams constructor.
33
     * @param $service
34
     * @param $mobile
35
     * @param $message
36
     */
37
    public function __construct(EngageSpark $service, string $mobile, string $message)
38
    {
39
        $this->service = $service;
40
        $this->mobile = $mobile;
41
        $this->message = $message;
42
    }
43
44
    public function toArray(): array
45
    {
46
        return [
47
            'organization_id' => $this->service->getOrgId(),
48
            'mobile_numbers' => Arr::wrap($this->mobile),
49
            'message' => $this->message,
50
            'sender_id' => $this->service->getSenderId(),
51
            'recipient_type'  => $this->recipientType,
52
        ];
53
    }
54
}
55