Completed
Push — master ( d9a404...9e6750 )
by Alexandre
02:12
created

Config   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 47
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setScopePolicy() 0 3 1
A __construct() 0 3 1
A getScopePolicy() 0 3 1
A setDefaultScopes() 0 3 1
A getDefaultScopes() 0 3 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Alexandre
5
 * Date: 06/03/2018
6
 * Time: 22:28
7
 */
8
9
namespace OAuth2;
10
11
12
use OAuth2\ScopePolicy\Policies\DefaultScopePolicy;
13
use OAuth2\ScopePolicy\Policies\ScopePolicyInterface;
14
15
class Config
16
{
17
    /**
18
     * @var array|null
19
     */
20
    protected $defaultScopes = [];
21
22
    /**
23
     * @var ScopePolicyInterface
24
     */
25
    protected $scopePolicy;
26
27
    public function __construct()
28
    {
29
        $this->scopePolicy = new DefaultScopePolicy([$this->defaultScopes]);
30
    }
31
32
    /**
33
     * @return array
34
     */
35
    public function getDefaultScopes(): ?array
36
    {
37
        return $this->defaultScopes;
38
    }
39
40
    /**
41
     * @param array $defaultScopes
42
     */
43
    public function setDefaultScopes(?array $defaultScopes): void
44
    {
45
        $this->defaultScopes = $defaultScopes;
46
    }
47
48
    /**
49
     * @return ScopePolicyInterface
50
     */
51
    public function getScopePolicy(): ScopePolicyInterface
52
    {
53
        return $this->scopePolicy;
54
    }
55
56
    /**
57
     * @param string $scopePolicy
58
     */
59
    public function setScopePolicy(string $scopePolicy): void
60
    {
61
        $this->scopePolicy = $scopePolicy;
0 ignored issues
show
Documentation Bug introduced by
It seems like $scopePolicy of type string is incompatible with the declared type OAuth2\ScopePolicy\Policies\ScopePolicyInterface of property $scopePolicy.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
62
    }
63
}