Passed
Push — master ( da0795...78880b )
by Jens
14:45 queued 18s
created

ClientCredentials::setClientId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Commercetools\Core\Client\OAuth;
4
5
class ClientCredentials
6
{
7
    const CLIENT_ID = 'clientId';
8
    const CLIENT_SECRET = 'clientSecret';
9
    const SCOPE = 'scope';
10
11
    /**
12
     * @var string
13
     */
14
    private $clientId;
15
16
    /**
17
     * @var string
18
     */
19
    private $clientSecret;
20
21
    private $scope;
22
23
    /**
24
     * @param array credentials
0 ignored issues
show
Bug introduced by
The type Commercetools\Core\Client\OAuth\credentials was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
25
     */
26 5
    public function __construct(array $credentials = [])
27
    {
28 5
        $this->clientId = isset($credentials[self::CLIENT_ID]) ? $credentials[self::CLIENT_ID] : null;
29 5
        $this->clientSecret = isset($credentials[self::CLIENT_SECRET]) ? $credentials[self::CLIENT_SECRET] : null;
30 5
        $this->scope = isset($credentials[self::SCOPE]) ? $credentials[self::SCOPE] : null;
31 5
    }
32
33
    /**
34
     * @return string
35
     */
36 5
    public function getClientId()
37
    {
38 5
        return $this->clientId;
39
    }
40
41
    /**
42
     * @param string $clientId
43
     * @return ClientCredentials
44
     */
45
    public function setClientId($clientId)
46
    {
47
        $this->clientId = $clientId;
48
        return $this;
49
    }
50
51
    /**
52
     * @return string
53
     */
54 2
    public function getClientSecret()
55
    {
56 2
        return $this->clientSecret;
57
    }
58
59
    /**
60
     * @return string
61
     */
62 5
    public function getScope()
63
    {
64 5
        return $this->scope;
65
    }
66
67
    /**
68
     * @param string $scope
69
     * @return ClientCredentials
70
     */
71
    public function setScope($scope)
72
    {
73
        $this->scope = $scope;
74
        return $this;
75
    }
76
77
78
    /**
79
     * @param string $clientSecret
80
     * @return ClientCredentials
81
     */
82
    public function setClientSecret($clientSecret)
83
    {
84
        $this->clientSecret = $clientSecret;
85
        return $this;
86
    }
87
}
88