| Conditions | 4 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | 9 | public static function exec(FilesystemInterface $vfs, string $id): FilesystemNodeInterface |
|
| 22 | { |
||
| 23 | 9 | if (!Exist::exec($vfs, $id)) { |
|
| 24 | 1 | throw new \Exception(\sprintf('Unknown path %s.', $id)); |
|
| 25 | } |
||
| 26 | |||
| 27 | 9 | $path = Path::fromString($id); |
|
| 28 | |||
| 29 | /** @var \drupol\phpvfs\Node\DirectoryInterface $cwd */ |
||
| 30 | 9 | $child = $path->isAbsolute() ? |
|
| 31 | 8 | $vfs->getCwd()->root() : |
|
| 32 | 9 | $vfs->getCwd(); |
|
| 33 | |||
| 34 | 9 | foreach ($path->getIterator() as $pathPart) { |
|
| 35 | 9 | $child = $child->containsAttributeId($pathPart); |
|
|
|
|||
| 36 | } |
||
| 37 | |||
| 38 | 9 | return $child; |
|
| 39 | } |
||
| 41 |