Client   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 11
c 1
b 0
f 0
dl 0
loc 63
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getIdentifier() 0 3 1
A getName() 0 3 1
A getRedirectUri() 0 3 1
A __construct() 0 5 1
A isConfidential() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Admin\Oauth2\Entity;
6
7
use League\OAuth2\Server\Entities\ClientEntityInterface;
8
9
class Client implements ClientEntityInterface
10
{
11
    protected string $identifier;
12
13
    protected string $name;
14
15
    protected string $redirectUri;
16
17
    /**
18
     * Client constructor.
19
     *
20
     * @param string $identifier
21
     * @param string $name
22
     * @param string $redirectUri
23
     */
24
    public function __construct(string $identifier, string $name, string $redirectUri)
25
    {
26
        $this->identifier  = $identifier;
27
        $this->name        = $name;
28
        $this->redirectUri = $redirectUri;
29
    }
30
31
    /**
32
     * Get the client's identifier.
33
     *
34
     * @return string
35
     */
36
    public function getIdentifier()
37
    {
38
        return $this->identifier;
39
    }
40
41
    /**
42
     * Get the client's name.
43
     *
44
     * @return string
45
     */
46
    public function getName()
47
    {
48
        return $this->name;
49
    }
50
51
    /**
52
     * Returns the registered redirect URI (as a string).
53
     *
54
     * Alternatively return an indexed array of redirect URIs.
55
     *
56
     * @return string|string[]
57
     */
58
    public function getRedirectUri()
59
    {
60
        return $this->redirectUri;
61
    }
62
63
    /**
64
     * Returns true if the client is confidential.
65
     *
66
     * @return bool
67
     */
68
    public function isConfidential()
69
    {
70
        // TODO: Improve
71
        return false;
72
    }
73
}
74