| Total Complexity | 4 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class Paths |
||
| 9 | { |
||
| 10 | const DELIMITER = '.'; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @param string[] $path |
||
| 14 | * @return string |
||
| 15 | */ |
||
| 16 | 6 | public static function toString(array $path) |
|
| 17 | { |
||
| 18 | 6 | return implode(self::DELIMITER, $path); |
|
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param string $input |
||
| 23 | * @return string[] |
||
| 24 | */ |
||
| 25 | 17 | public static function fromString($input) |
|
| 26 | { |
||
| 27 | 17 | return array_filter(explode(self::DELIMITER, $input)); |
|
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param string|string[] $path |
||
| 32 | * @return string[] |
||
| 33 | */ |
||
| 34 | 23 | public static function normalize($path) |
|
| 37 | } |
||
| 38 | } |
||
| 39 |