Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
47 | 5 | public function build(Name $name): object |
|
48 | { |
||
49 | try { |
||
50 | 5 | $root = $name->root(); |
|
51 | 1 | } catch (NameNotNamespaced $e) { |
|
52 | 1 | throw new ReferenceNotFound((string) $name); |
|
53 | } |
||
54 | |||
55 | 4 | if (!$this->dependencies->contains((string) $root)) { |
|
56 | 1 | throw new ReferenceNotFound((string) $name); |
|
57 | } |
||
58 | |||
59 | try { |
||
60 | return $this |
||
61 | 3 | ->dependencies |
|
62 | 3 | ->get((string) $root) |
|
63 | 3 | ->build($name->withoutRoot()); |
|
64 | 2 | } catch (ReferenceNotFound $e) { |
|
65 | 1 | throw new ReferenceNotFound((string) $name, 0, $e); |
|
66 | } |
||
69 |