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

Scope   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 3 1
A isParentMandatory() 0 3 1
A getParent() 0 3 1
A getName() 0 3 1
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