ClientTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 39
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getRedirectUri() 0 3 1
A isConfidential() 0 3 1
A getName() 0 3 1
1
<?php
2
3
/**
4
 * @author      Alex Bilbie <[email protected]>
5
 * @copyright   Copyright (c) Alex Bilbie
6
 * @license     http://mit-license.org/
7
 *
8
 * @link        https://github.com/thephpleague/oauth2-server
9
 */
10
11
declare(strict_types=1);
12
13
namespace League\OAuth2\Server\Entities\Traits;
14
15
trait ClientTrait
16
{
17
    protected string $name;
18
19
    /**
20
     * @var string|string[]
21
     */
22
    protected string|array $redirectUri;
23
24
    protected bool $isConfidential = false;
25
26
    /**
27
     * Get the client's name.
28
     *
29
     *
30
     * @codeCoverageIgnore
31
     */
32
    public function getName(): string
33
    {
34
        return $this->name;
35
    }
36
37
    /**
38
     * Returns the registered redirect URI (as a string). Alternatively return
39
     * an indexed array of redirect URIs.
40
     *
41
     * @return string|string[]
42
     */
43 44
    public function getRedirectUri(): string|array
44
    {
45 44
        return $this->redirectUri;
46
    }
47
48
    /**
49
     * Returns true if the client is confidential.
50
     */
51 32
    public function isConfidential(): bool
52
    {
53 32
        return $this->isConfidential;
54
    }
55
}
56