Passed
Push — master ( c858e1...becd64 )
by Filipe
12:31 queued 19s
created

UserToken   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 3
dl 0
loc 7
rs 10
c 1
b 0
f 0

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\Token\AbstractToken;
15
use Slick\WebStack\Domain\Security\Authentication\TokenInterface;
16
use Slick\WebStack\Domain\Security\UserInterface;
17
18
/**
19
 * UserToken
20
 *
21
 * @package Slick\WebStack\Domain\Security\Authentication\Token
22
 * @implements TokenInterface<UserInterface>
23
 */
24
final class UserToken extends AbstractToken implements TokenInterface
25
{
26
27
    public function __construct(UserInterface $user)
28
    {
29
        $this->user = $user;
30
        parent::__construct($user->roles());
31
    }
32
}
33