Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function resolve(NameInterface $baseName, NameInterface $toResolve): NameInterface |
||
13 | { |
||
14 | if (is_file($toResolve->getNamespaceName())) { |
||
15 | return new ExampleName($toResolve->getShortName(), (string)realpath($toResolve->getNamespaceName())); |
||
16 | } |
||
17 | |||
18 | $resolved = dirname($baseName->getNamespaceName()) . DIRECTORY_SEPARATOR . $toResolve->getNamespaceName(); |
||
19 | |||
20 | if (is_file($resolved)) { |
||
21 | return new ExampleName($toResolve->getShortName(), (string)realpath($resolved)); |
||
22 | } |
||
23 | |||
24 | return $toResolve; |
||
25 | } |
||
27 |