UsernamePasswordToken   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 3
c 0
b 0
f 0
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of web-stack
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Slick\WebStack\Domain\Security\Authentication\Token;
13
14
use Slick\WebStack\Domain\Security\Authentication\TokenInterface;
15
use Slick\WebStack\Domain\Security\Common\AttributesBagMethods;
16
use Slick\WebStack\Domain\Security\UserInterface;
17
18
/**
19
 * UsernamePasswordToken
20
 *
21
 * @package Slick\WebStack\Domain\Security\Authentication\Token
22
 *
23
 * @implements  TokenInterface<UserInterface>
24
 */
25
final class UsernamePasswordToken extends AbstractToken implements TokenInterface
26
{
27
28
    /**
29
     * Class constructor.
30
     *
31
     * @param UserInterface $user The user object.
32
     * @param array<string, mixed> $roles The user's roles.
33
     */
34
    public function __construct(UserInterface $user, array $roles = [])
35
    {
36
        parent::__construct($roles);
37
        $this->user = $user;
38
    }
39
}
40