Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
57 | public static function getSubPathOf(array $subDir, array $parentDir) |
||
58 | { |
||
59 | if (!self::isSubDirectoryOf($subDir, $parentDir)) { |
||
60 | throw new \RuntimeException('Invalid sub directory'); |
||
61 | } |
||
62 | |||
63 | $path = []; |
||
64 | foreach (array_slice($subDir, count($parentDir)) as $dir) { |
||
65 | $path[] = $dir; |
||
66 | } |
||
67 | return implode(DIRECTORY_SEPARATOR, $path); |
||
68 | } |
||
69 | } |
||
70 |