Completed
Push — master ( ff92f6...3ef1d3 )
by John
09:08
created

JwtAuthenticationToken::getCredentials()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php declare(strict_types = 1);
2
/*
3
 * This file is part of the KleijnWeb\JwtBundle package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace KleijnWeb\JwtBundle\Authentication;
10
11
use Symfony\Component\Security\Core\Authentication\Token\AbstractToken;
12
13
class JwtAuthenticationToken extends AbstractToken
14
{
15
    /**
16
     * @var string
17
     */
18
    private $tokenString;
19
20
    /**
21
     * @param array  $roles
22
     * @param string $tokenString
23
     */
24
    public function __construct(array $roles = [], string $tokenString = null)
25
    {
26
        $this->tokenString = $tokenString;
27
        parent::__construct($roles);
28
29
        $this->setAuthenticated(count($roles) > 0);
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function getCredentials()
36
    {
37
        return $this->tokenString;
38
    }
39
}