| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | public function resolve(Psr4Namespace $namespace): string |
||
| 44 | { |
||
| 45 | if (!$namespace->startsWith($this->namespace)) { |
||
| 46 | throw new Exception($namespace->getValue() . ' is not from the same base as ' . $this->namespace->getValue()); |
||
| 47 | } |
||
| 48 | $relFqn = substr($namespace->getValue(), strlen($this->namespace->getValue())); |
||
| 49 | $relPath = $this->nsToPath($relFqn); |
||
| 50 | |||
| 51 | $absPath = realpath($this->path . DIRECTORY_SEPARATOR . $relPath); |
||
| 52 | |||
| 53 | return $absPath ?: ''; |
||
| 54 | } |
||
| 55 | |||
| 70 |