Passed
Push — master ( 056350...65484c )
by Satoshi
05:02
created

DepsInternal   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 42
rs 10
c 0
b 0
f 0
wmc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getEqden() 0 3 1
A getTargets() 0 3 1
A __construct() 0 11 3
1
<?php
2
declare(strict_types=1);
3
4
namespace DependencyAnalyzer\DependencyGraph\ExtraPhpDocTagResolver;
5
6
use DependencyAnalyzer\DependencyGraph\FullyQualifiedStructuralElementName;
7
use DependencyAnalyzer\DependencyGraph\FullyQualifiedStructuralElementName\Base as FQSEN;
8
use DependencyAnalyzer\Exceptions\InvalidFullyQualifiedStructureElementNameException;
9
10
class DepsInternal
11
{
12
    /**
13
     * @var FQSEN
14
     */
15
    protected $fqden;
16
17
    /**
18
     * @var array
19
     */
20
    protected $options;
21
22
    /**
23
     * @var FQSEN[]
24
     */
25
    protected $targets = [];
26
27
    public function __construct(FQSEN $fqden, array $options = [])
28
    {
29
        $this->fqden = $fqden;
30
        $this->options = $options;
31
32
        try {
33
            foreach ($this->options as $option) {
34
                $this->targets[] = FullyQualifiedStructuralElementName::createFromString($option);
35
            }
36
        } catch (InvalidFullyQualifiedStructureElementNameException $e) {
37
            throw $e;
38
        }
39
    }
40
41
    public function getEqden(): FQSEN
42
    {
43
        return $this->fqden;
44
    }
45
46
    /**
47
     * @return FQSEN[]
48
     */
49
    public function getTargets(): array
50
    {
51
        return $this->targets;
52
    }
53
}
54