Failed Conditions
Push — master ( 3a5b4f...2f8291 )
by Florent
03:42
created

Scope::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * The MIT License (MIT)
7
 *
8
 * Copyright (c) 2014-2019 Spomky-Labs
9
 *
10
 * This software may be modified and distributed under the terms
11
 * of the MIT license.  See the LICENSE file for details.
12
 */
13
14
namespace OAuth2Framework\ServerBundle\Tests\TestBundle\Entity;
15
16
use OAuth2Framework\Component\Scope\Scope as ScopeInterface;
17
18
final class Scope implements ScopeInterface
19
{
20
    /**
21
     * @var string
22
     */
23
    private $name;
24
25
    /**
26
     * @var string
27
     */
28
    private $parent;
29
30
    /**
31
     * @var bool
32
     */
33
    private $isParentMandatory;
34
35
    /**
36
     * Scope constructor.
37
     */
38
    public function __construct(string $name, string $parent = null, bool $isParentMandatory = false)
39
    {
40
        $this->name = $name;
41
        $this->parent = $parent;
42
        $this->isParentMandatory = $isParentMandatory;
43
    }
44
45
    public function __toString(): string
46
    {
47
        return $this->getName();
48
    }
49
50
    public function getParent(): ?string
51
    {
52
        return $this->parent;
53
    }
54
55
    public function isParentMandatory(): bool
56
    {
57
        return $this->isParentMandatory;
58
    }
59
60
    public function getName(): string
61
    {
62
        return $this->name;
63
    }
64
}
65