Completed
Branch feature/pre-split (197e7e)
by Anton
03:26
created

Actor::__construct()   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
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
rs 10
1
<?php
2
/**
3
 * Spiral Framework.
4
 *
5
 * @license   MIT
6
 * @author    Anton Titov (Wolfy-J)
7
 */
8
namespace Spiral\Security\Actors;
9
10
use Spiral\Security\ActorInterface;
11
12
/**
13
 * Simple actor with role dependency.
14
 */
15
class Actor implements ActorInterface
16
{
17
    /**
18
     * @var array
19
     */
20
    private $roles = [];
21
22
    /**
23
     * @param array $roles
24
     */
25
    public function __construct(array $roles)
26
    {
27
        $this->roles = $roles;
28
    }
29
30
    /**
31
     * @return array
32
     */
33
    public function getRoles(): array
34
    {
35
        return $this->roles;
36
    }
37
}