Passed
Branch develop (7f369c)
by Nicolas
04:17
created

JWTAuthenticator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getTokenExtractor() 0 6 1
1
<?php
2
3
namespace App\Security;
4
5
use Lexik\Bundle\JWTAuthenticationBundle\Security\Guard\JWTTokenAuthenticator as BaseJWTAuthenticator;
6
use Lexik\Bundle\JWTAuthenticationBundle\TokenExtractor\AuthorizationHeaderTokenExtractor;
7
8
/**
9
 * JWTAuthenticator.
10
 */
11
class JWTAuthenticator extends BaseJWTAuthenticator
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16 21
    protected function getTokenExtractor()
17
    {
18 21
        $chainExtractor = parent::getTokenExtractor();
19 21
        $chainExtractor->addExtractor(new AuthorizationHeaderTokenExtractor('Token', 'Authorization'));
0 ignored issues
show
Bug introduced by
The method addExtractor() does not exist on Lexik\Bundle\JWTAuthenti...TokenExtractorInterface. It seems like you code against a sub-type of Lexik\Bundle\JWTAuthenti...TokenExtractorInterface such as Lexik\Bundle\JWTAuthenti...tor\ChainTokenExtractor. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
        $chainExtractor->/** @scrutinizer ignore-call */ 
20
                         addExtractor(new AuthorizationHeaderTokenExtractor('Token', 'Authorization'));
Loading history...
20
21 21
        return $chainExtractor;
22
    }
23
}
24