Completed
Push — master ( 64cd9f...411f65 )
by Alexandre
02:13
created

DefaultScopePolicy   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 10
c 0
b 0
f 0
ccs 0
cts 4
cp 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setScopes() 0 3 1
A getScopes() 0 3 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: GCC-MED
5
 * Date: 15/01/2018
6
 * Time: 11:50
7
 */
8
9
namespace OAuth2\ScopePolicy\Policies;
10
11
12
use OAuth2\Roles\ClientInterface;
13
14
class DefaultScopePolicy implements ScopePolicyInterface
15
{
16
    /**
17
     * @var array
18
     */
19
    private $scopes = [];
20
21
    public function setScopes(array $scopes)
22
    {
23
        $this->scopes = $scopes;
24
    }
25
26
    function getScopes(ClientInterface $client, ?string $scope): array
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
27
    {
28
        return is_null($scope) ? $this->scopes : explode(' ', $scope);
29
    }
30
}