Conditions | 4 |
Paths | 4 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4.0466 |
Changes | 0 |
1 | <?php |
||
33 | 2 | public function getImaginePath(?string $filePath = null): ?string |
|
34 | { |
||
35 | 2 | if (!$filePath) { |
|
36 | return $filePath; |
||
37 | } |
||
38 | 2 | foreach ($this->rootPaths as $rootPath) { |
|
39 | 2 | if (strpos($filePath, $rootPath) === 0) { |
|
40 | 2 | return substr($filePath, \strlen($rootPath)); |
|
41 | } |
||
42 | } |
||
43 | 1 | return $filePath; |
|
44 | } |
||
46 |