Passed
Branch master (372b2a)
by Filipe
01:32
created

UsernamePasswordToken::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 2
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
 * @template TUser of UserInterface
23
 *
24
 * @implements  TokenInterface<TUser>
25
 * @extends AbstractToken<TUser>
26
 */
27
final class UsernamePasswordToken extends AbstractToken implements TokenInterface
28
{
29
30
    /**
31
     * Class constructor.
32
     *
33
     * @param TUser $user The user object.
0 ignored issues
show
Bug introduced by
The type Slick\WebStack\Domain\Se...hentication\Token\TUser was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
34
     * @param array<string, mixed> $roles The user's roles.
35
     */
36
    public function __construct(UserInterface $user, array $roles = [])
37
    {
38
        parent::__construct($roles);
39
        $this->user = $user;
40
    }
41
}
42