| Conditions | 3 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 4.5435 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 60 | 2 | protected static function stripAbsolutePath(array $paths, $plugin = null) |
|
| 61 | { |
||
| 62 | 2 | foreach (App::path('Template', $plugin) as $templatesPath) { |
|
| 63 | array_walk($paths, function (&$path) use ($templatesPath) { |
||
| 64 | if (substr($path, 0, strlen($templatesPath)) == $templatesPath) { |
||
| 65 | $path = substr($path, strlen($templatesPath)); |
||
| 66 | } |
||
| 67 | }); |
||
| 68 | } |
||
| 69 | |||
| 70 | 2 | return $paths; |
|
| 71 | 2 | } |
|
| 72 | } |
||
| 73 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: