Conditions | 5 |
Paths | 5 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
17 | 40 | public function fullyQualifiedNameFor(Name $name): string |
|
18 | { |
||
19 | 40 | foreach ($this->useStatements as $useStatement) { |
|
20 | 26 | if ($useStatement->endsWith($name)) { |
|
21 | 22 | return $useStatement->fullyQualifiedName($name); |
|
22 | } |
||
23 | 21 | if ($useStatement->includes($name)) { |
|
24 | 2 | return $useStatement->merge($name); |
|
25 | } |
||
26 | 19 | if ($useStatement->isAliasedAs($name)) { |
|
27 | 5 | return $useStatement->fullyQualifiedName($name); |
|
28 | } |
||
29 | } |
||
30 | 31 | return (string) $name; |
|
31 | } |
||
33 |