Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
36 | 7 | private function execute(): void |
|
37 | { |
||
38 | // Get rale path from provided path (because it can be relative) |
||
39 | 7 | $real = realpath($this->path); |
|
40 | |||
41 | // Throw an exception if the path does not exist |
||
42 | 7 | if (!$real) { |
|
43 | 1 | throw new PathNotFoundException($this->path); |
|
44 | } |
||
45 | |||
46 | // Get directory name by provided real path |
||
47 | 6 | $base = basename($real); |
|
48 | |||
49 | // Calculate trimmed length between real path and directory only |
||
50 | 6 | $this->trimLength = mb_strlen($real) - mb_strlen($base); |
|
51 | 6 | } |
|
77 |