Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
43 | private function execute(): void |
||
44 | { |
||
45 | // Get rale path from provided path (because it can be relative) |
||
46 | $real = realpath($this->path); |
||
47 | |||
48 | // Throw an exception if the path does not exist |
||
49 | if (!$real) { |
||
50 | throw new PathNotFoundException($this->path); |
||
51 | } |
||
52 | |||
53 | // Get directory name by provided real path |
||
54 | $base = basename($real); |
||
55 | |||
56 | // Calculate trimmed length between real path and directory only |
||
57 | $this->trimLength = mb_strlen($real) - mb_strlen($base); |
||
58 | } |
||
92 |