Client   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 61
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A getIdentifier() 0 4 1
A setIdentifier() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Rinvex\Oauth\Bridge;
6
7
use League\OAuth2\Server\Entities\Traits\ClientTrait;
8
use League\OAuth2\Server\Entities\ClientEntityInterface;
9
10
class Client implements ClientEntityInterface
11
{
12
    use ClientTrait;
13
14
    /**
15
     * The client identifier.
16
     *
17
     * @var string
18
     */
19
    protected $identifier;
20
21
    /**
22
     * The client's user type.
23
     *
24
     * @var string
25
     */
26
    public $userType;
27
28
    /**
29
     * Create a new client instance.
30
     *
31
     * @param string $identifier
32
     * @param string $name
33
     * @param string $redirectUri
34
     * @param string $userType
35
     * @param bool   $isConfidential
36
     *
37
     * @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...
38
     */
39
    public function __construct($identifier, $name, $redirectUri, $userType, $isConfidential = false)
40
    {
41
        $this->setIdentifier((string) $identifier);
42
43
        $this->name = $name;
44
        $this->userType = $userType;
45
        $this->isConfidential = $isConfidential;
46
        $this->redirectUri = explode(',', $redirectUri);
47
    }
48
49
    /**
50
     * Get the client's identifier.
51
     *
52
     * @return string
53
     */
54
    public function getIdentifier()
55
    {
56
        return (string) $this->identifier;
57
    }
58
59
    /**
60
     * Set the client's identifier.
61
     *
62
     * @param string $identifier
63
     *
64
     * @return void
65
     */
66
    public function setIdentifier($identifier)
67
    {
68
        $this->identifier = $identifier;
69
    }
70
}
71