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 ( e9bac1...624400 )
by Lester
01:25
created

SendMessage::getParams()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace LBHurtado\EngageSpark\Jobs;
4
5
use Illuminate\Bus\Queueable;
6
use LBHurtado\EngageSpark\EngageSpark;
7
use Illuminate\Queue\SerializesModels;
8
use Illuminate\Queue\InteractsWithQueue;
9
use Illuminate\Contracts\Queue\ShouldQueue;
10
use Illuminate\Foundation\Bus\Dispatchable;
11
use LBHurtado\EngageSpark\Classes\ServiceMode;
12
use LBHurtado\EngageSpark\Classes\SendHttpApiParams;
13
14
class SendMessage implements ShouldQueue
15
{
16
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
17
18
    /** @var string */
19
    public $mobile;
20
21
    /** @var string */
22
    public $message;
23
24
    /** @var SendHttpApiParams */
25
    public $params;
26
27
    /**
28
     * SendMessage constructor.
29
     * @param string $mobile
30
     * @param string $message
31
     */
32
    public function __construct($mobile, $message)
33
    {
34
        $this->mobile = $mobile;
35
        $this->message = $message;
36
    }
37
38
    /**
39
     * @param EngageSpark $service
40
     * @throws \GuzzleHttp\Exception\GuzzleException
41
     */
42
    public function handle(EngageSpark $service)
43
    {
44
        $service->send($this->getParams($service)->toArray(), ServiceMode::SMS);
45
    }
46
47
    public function getParams(EngageSpark $service)
48
    {
49
        return new SendHttpApiParams($service, $this->mobile, $this->message);
50
    }
51
}
52