SimpleScopeResolver   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A initScopes() 0 3 1
A getCurrentScope() 0 3 1
1
<?php
2
/**
3
 * @author    oliverde8<[email protected]>
4
 * @category  @category  oliverde8/ComfyBundle
5
 */
6
7
namespace oliverde8\ComfyBundle\Resolver;
8
9
use oliverde8\AssociativeArraySimplified\AssociativeArray;
10
11
class SimpleScopeResolver extends AbstractScopeResolver implements ScopeResolverInterface
12
{
13
    /** @var string */
14
    protected string $defaultScope;
15
16
    /** @var array */
17
    protected array $scopes;
18
19
    /**
20
     * SimpleScopeResolver constructor.
21
     *
22
     * @param string $defaultScope
23
     * @param array $scopes
24
     */
25
    public function __construct(string $defaultScope, array $scopes)
26
    {
27
        $this->defaultScope = $defaultScope;
28
        $this->scopes = $scopes;
29
    }
30
31
32
    /**
33
     * @inheritDoc
34
     */
35
    public function getCurrentScope(): string
36
    {
37
        return $this->defaultScope;
38
    }
39
40
    /**
41
     * @inheritDoc
42
     */
43
    protected function initScopes(): array
44
    {
45
        return $this->scopes;
46
    }
47
}
48