Passed
Push — master ( 6ea451...1ef48a )
by Anton
01:35
created

Reference   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __role() 0 3 1
A __scope() 0 3 1
1
<?php
2
declare(strict_types=1);
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
namespace Cycle\ORM\Promise;
11
12
class Reference implements ReferenceInterface
13
{
14
    /** @var string */
15
    private $role;
16
17
    /** @var array */
18
    private $scope = [];
19
20
    /**
21
     * @param string $role
22
     * @param array  $scope
23
     */
24
    public function __construct(string $role, array $scope)
25
    {
26
        $this->role = $role;
27
        $this->scope = $scope;
28
    }
29
30
    /**
31
     * @inheritdoc
32
     */
33
    public function __role(): string
34
    {
35
        return $this->role;
36
    }
37
38
    /**
39
     * @inheritdoc
40
     */
41
    public function __scope(): array
42
    {
43
        return $this->scope;
44
    }
45
}