Completed
Push — b0.25.0 ( b1670c...6acf42 )
by Sebastian
05:31
created

EnhancedUser::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 1
1
<?php
2
3
/**
4
 * Linna Framework.
5
 *
6
 * @author Sebastian Rapetti <[email protected]>
7
 * @copyright (c) 2018, Sebastian Rapetti
8
 * @license http://opensource.org/licenses/MIT MIT License
9
 */
10
declare(strict_types=1);
11
12
namespace Linna\Authorization;
13
14
use Linna\Authentication\Password;
15
use Linna\Authentication\User;
16
17
/**
18
 * Enhanched User.
19
 */
20
class EnhancedUser extends User
21
{
22
    use PermissionTrait;
23
24
    /**
25
     * @var array Contain roles for the user
26
     */
27
    private $roles = [];
28
29
    /**
30
     * Class Constructor.
31
     *
32
     * @param Password $password
33
     * @param array    $roles
34
     * @param array    $permissions
35
     */
36 1
    public function __construct(Password $password, array $roles = [], array $permissions = [])
37
    {
38 1
        parent::__construct($password);
39
40 1
        $this->roles = $roles;
41 1
        $this->permission = $permissions;
42 1
    }
43
}
44