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.

TopupHttpApiParams   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 53
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A toArray() 0 9 1
1
<?php
2
3
namespace LBHurtado\EngageSpark\Classes;
4
5
use LBHurtado\EngageSpark\EngageSpark;
6
use LBHurtado\Common\Contracts\HttpApiParams;
7
8
class TopupHttpApiParams implements HttpApiParams
9
{
10
    /**
11
     * @var EngageSpark
12
     */
13
    protected $service;
14
15
    /**
16
     * @var string
17
     */
18
    protected $mobile;
19
20
    /**
21
     * @var int
22
     */
23
    protected $amount;
24
25
    /**
26
     * @var string
27
     */
28
    protected $recipientType = 'mobile_number';
29
30
    /**
31
     * @var string
32
     */
33
    protected $reference;
34
35
    /**
36
     * SendParams constructor.
37
     * @param $service
38
     * @param $mobile_number
39
     * @param $amount
40
     * @param $reference
41
     */
42
    public function __construct(EngageSpark $service, string $mobile, int $amount, string $reference)
43
    {
44
        $this->service = $service;
45
        $this->mobile = $mobile;
46
        $this->amount = $amount;
47
        $this->reference = $reference;
48
    }
49
50
    //TODO: make this independent of provider, right now it's engagespark
51
    public function toArray(): array
52
    {
53
        return [
54
            'organizationId' => $this->service->getOrgId(),
55
            'phoneNumber' => $this->mobile,
56
            'maxAmount' => $this->amount,
57
            'clientRef'  => $this->reference,
58
        ];
59
    }
60
}
61