Credentials   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Test Coverage

Coverage 64.71%

Importance

Changes 0
Metric Value
wmc 5
eloc 17
dl 0
loc 52
c 0
b 0
f 0
ccs 11
cts 17
cp 0.6471
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getGrantType() 0 3 1
A getClientSecret() 0 3 1
A getClientId() 0 3 1
A __construct() 0 6 1
A getParameters() 0 7 1
1
<?php
2
3
namespace Xsolve\SalesforceClient\Security\Authentication;
4
5
class Credentials
6
{
7
    /**
8
     * @var string
9
     */
10
    private $clientId;
11
12
    /**
13
     * @var string
14
     */
15
    private $clientSecret;
16
17
    /**
18
     * @var string
19
     */
20
    private $grantType;
21
22
    /**
23
     * @var array
24
     */
25
    private $extraParams;
26
27 1
    public function __construct(string $clientId, string $clientSecret, string $grantType, array $extraParams = [])
28
    {
29 1
        $this->clientId = $clientId;
30 1
        $this->clientSecret = $clientSecret;
31 1
        $this->grantType = $grantType;
32 1
        $this->extraParams = $extraParams;
33 1
    }
34
35
    public function getClientId(): string
36
    {
37
        return $this->clientId;
38
    }
39
40
    public function getClientSecret(): string
41
    {
42
        return $this->clientSecret;
43
    }
44
45
    public function getGrantType(): string
46
    {
47
        return $this->grantType;
48
    }
49
50 1
    public function getParameters(): array
51
    {
52
        return [
53 1
            'client_id' => $this->clientId,
54 1
            'client_secret' => $this->clientSecret,
55 1
            'grant_type' => $this->grantType,
56 1
        ] + $this->extraParams;
57
    }
58
}
59