ScopeRepository   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 25
rs 10
c 0
b 0
f 0
ccs 0
cts 6
cp 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getScopeEntityByIdentifier() 0 6 2
A finalizeScopes() 0 9 1
1
<?php
2
3
namespace CodexShaper\OAuth2\Server\Repositories;
4
5
use CodexShaper\OAuth2\Server\Entities\Scope as ScopeEntity;
6
use CodexShaper\OAuth2\Server\Manager;
7
use League\OAuth2\Server\Entities\ClientEntityInterface;
8
use League\OAuth2\Server\Repositories\ScopeRepositoryInterface;
9
10
class ScopeRepository implements ScopeRepositoryInterface
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function getScopeEntityByIdentifier($identifier)
16
    {
17
        if (Manager::hasScope($identifier)) {
18
            return new ScopeEntity($identifier);
19
        }
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function finalizeScopes(
26
        array $scopes,
27
        $grantType,
28
        ClientEntityInterface $clientEntity,
29
        $userIdentifier = null
30
    )
31
    {
32
        return Manager::filterScopes($scopes, $grantType, $clientEntity, $userIdentifier);
0 ignored issues
show
Unused Code introduced by
The call to Manager::filterScopes() has too many arguments starting with $clientEntity.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
33
    }
34
}
35