Passed
Push — master ( 63d167...fb60c6 )
by Rutger
03:11
created

Oauth2BaseClientScopeAuthorizationRequest   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 88
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 8
eloc 17
dl 0
loc 88
ccs 20
cts 20
cp 1
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A setHasBeenRejectedBefore() 0 4 1
A setIsRequired() 0 4 1
A setIsAccepted() 0 4 1
A setScope() 0 4 1
A getHasBeenRejectedBefore() 0 3 1
A getScope() 0 3 1
A getIsAccepted() 0 3 1
A getIsRequired() 0 3 1
1
<?php
2
3
namespace rhertogh\Yii2Oauth2Server\components\authorization\client\base;
4
5
use rhertogh\Yii2Oauth2Server\interfaces\components\authorization\client\Oauth2ClientScopeAuthorizationRequestInterface;
6
use rhertogh\Yii2Oauth2Server\interfaces\models\Oauth2ScopeInterface;
7
use yii\base\Component;
8
9
abstract class Oauth2BaseClientScopeAuthorizationRequest extends Component implements Oauth2ClientScopeAuthorizationRequestInterface
10
{
11
    /**
12
     * @var Oauth2ScopeInterface|null
13
     */
14
    protected $_scope = null;
15
16
    /**
17
     * @var bool
18
     */
19
    protected bool $_isRequired = true;
20
21
    /**
22
     * @var bool
23
     */
24
    protected bool $_isAccepted = false;
25
26
    /**
27
     * @var bool
28
     */
29
    protected bool $_hasBeenRejectedBefore = false;
30
31
    /**
32
     * @inheritDoc
33
     */
34 3
    public function getScope(): Oauth2ScopeInterface
35
    {
36 3
        return $this->_scope;
37
    }
38
39
    /**
40
     * @inheritDoc
41
     */
42 3
    public function setScope(Oauth2ScopeInterface $scope)
43
    {
44 3
        $this->_scope = $scope;
45 3
        return $this;
46
    }
47
48
    /**
49
     * @inheritDoc
50
     */
51 3
    public function getIsRequired(): bool
52
    {
53 3
        return $this->_isRequired;
54
    }
55
56
    /**
57
     * @inheritDoc
58
     */
59 3
    public function setIsRequired(bool $isRequired)
60
    {
61 3
        $this->_isRequired = $isRequired;
62 3
        return $this;
63
    }
64
65
    /**
66
     * @inheritDoc
67
     */
68 3
    public function getIsAccepted(): bool
69
    {
70 3
        return $this->_isAccepted;
71
    }
72
73
    /**
74
     * @inheritDoc
75
     */
76 3
    public function setIsAccepted(bool $isAccepted)
77
    {
78 3
        $this->_isAccepted = $isAccepted;
79 3
        return $this;
80
    }
81
82
    /**
83
     * @inheritDoc
84
     */
85 3
    public function getHasBeenRejectedBefore(): bool
86
    {
87 3
        return $this->_hasBeenRejectedBefore;
88
    }
89
90
    /**
91
     * @inheritDoc
92
     */
93 3
    public function setHasBeenRejectedBefore(bool $hasBeenRejectedBefore)
94
    {
95 3
        $this->_hasBeenRejectedBefore = $hasBeenRejectedBefore;
96 3
        return $this;
97
    }
98
}
99