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