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