These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace AdvancedLearning\Oauth2Server\Repositories; |
||
4 | |||
5 | use AdvancedLearning\Oauth2Server\Models\Scope; |
||
6 | use League\OAuth2\Server\Entities\ClientEntityInterface; |
||
7 | use League\OAuth2\Server\Repositories\ScopeRepositoryInterface; |
||
8 | |||
9 | class ScopeRepository implements ScopeRepositoryInterface |
||
10 | { |
||
11 | /** |
||
12 | * {@inheritDoc} |
||
13 | */ |
||
14 | public function getScopeEntityByIdentifier($identifier) |
||
15 | { |
||
16 | if ($scope = Scope::get()->filter(['Name' => $identifier])->first()) { |
||
0 ignored issues
–
show
|
|||
17 | return new \AdvancedLearning\Oauth2Server\Entities\ScopeEntity($identifier); |
||
18 | } |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * {@inheritDoc} |
||
23 | */ |
||
24 | public function finalizeScopes( |
||
25 | array $scopes, |
||
26 | $grantType, |
||
27 | ClientEntityInterface $clientEntity, |
||
28 | $userIdentifier = null |
||
29 | ) { |
||
30 | return $scopes; |
||
31 | } |
||
32 | } |
||
33 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.