Client::setIdentifier()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 3
cp 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace CodexShaper\OAuth2\Server\Entities;
4
5
use League\OAuth2\Server\Entities\ClientEntityInterface;
6
use League\OAuth2\Server\Entities\Traits\ClientTrait;
7
8
class Client implements ClientEntityInterface
9
{
10
    use ClientTrait;
11
12
    /**
13
     * The client identifier.
14
     *
15
     * @var string
16
     */
17
    protected $identifier;
18
19
    /**
20
     * Create a new client instance.
21
     *
22
     * @param string $identifier
23
     * @param string $name
24
     * @param string $redirectUri
25
     * @param bool   $isConfidential
26
     *
27
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
28
     */
29
    public function __construct($identifier, $name, $redirectUri, $isConfidential = false)
30
    {
31
        $this->setIdentifier((string) $identifier);
32
33
        $this->name = $name;
34
        $this->isConfidential = $isConfidential;
35
        $this->redirectUri = explode(',', $redirectUri);
36
    }
37
38
    /**
39
     * Get the client's identifier.
40
     *
41
     * @return string
42
     */
43
    public function getIdentifier()
44
    {
45
        return (string) $this->identifier;
46
    }
47
48
    /**
49
     * Set the client's identifier.
50
     *
51
     * @param string $identifier
52
     */
53
    public function setIdentifier($identifier)
54
    {
55
        $this->identifier = $identifier;
56
    }
57
}
58