| Conditions | 4 |
| Paths | 6 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | 1 | public static function exec(FilesystemInterface $vfs, string $id) |
|
| 17 | { |
||
| 18 | 1 | $path = Path::fromString($id); |
|
| 19 | |||
| 20 | /** @var \drupol\phpvfs\Node\DirectoryInterface $cwd */ |
||
| 21 | 1 | $cwd = $path->isAbsolute() ? |
|
| 22 | 1 | $vfs->getCwd()->root() : |
|
| 23 | 1 | $vfs->getCwd(); |
|
| 24 | |||
| 25 | 1 | foreach ($path->getIterator() as $pathPart) { |
|
| 26 | 1 | if (null !== $child = $cwd->containsAttributeId($pathPart)) { |
|
| 27 | 1 | $cwd = $child; |
|
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | 1 | $vfs->setCwd($cwd); |
|
| 32 | 1 | } |
|
| 34 |