| Conditions | 4 |
| Paths | 8 |
| Total Lines | 13 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | 30 | public static function create( |
|
| 25 | string $msg, |
||
| 26 | string $path, |
||
| 27 | string $delimiter, |
||
| 28 | array $index, |
||
| 29 | ?string $key = null, |
||
| 30 | ?\Throwable $previous = null |
||
| 31 | ): ResolveException { |
||
| 32 | 30 | $len = ($index !== [] ? \strlen($delimiter) + \strlen(\join($delimiter, $index)) : 0) |
|
| 33 | 30 | + ($key !== null ? \strlen($delimiter) + \strlen($key) : 0); |
|
| 34 | 30 | $invalidPath = $len > 0 ? \substr(\rtrim($path, $delimiter), 0, -1 * $len) : $path; |
|
| 35 | |||
| 36 | 30 | return new ResolveException(sprintf($msg, $invalidPath), 0, $previous); |
|
| 37 | } |
||
| 39 |