| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | 10 | public static function fromString(string $path): ConfigPathInterface |
|
| 22 | { |
||
| 23 | 10 | $separatorPosition = strpos($path, self::PATH_SEP); |
|
| 24 | 10 | if ($separatorPosition === 0) { |
|
| 25 | 1 | throw new \Exception("Initializing malformed ConfigPath: Path may not start with separator."); |
|
| 26 | } |
||
| 27 | 9 | $pathParts = explode(self::PATH_SEP, $path); |
|
| 28 | 9 | return new static(array_shift($pathParts), $pathParts); |
|
| 29 | } |
||
| 30 | |||
| 67 |