ScopeRepository::finalizeScopes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 4
crap 2
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
        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...
32
    }
33
}
34