Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3.0175 |
Changes | 0 |
1 | <?php namespace Arcanesoft\Media\Helpers; |
||
22 | public static function directories(array $patterns) |
||
23 | { |
||
24 | 22 | $patterns = array_map(function ($pattern) { |
|
25 | 22 | return trim($pattern, '/'); |
|
26 | 22 | }, $patterns); |
|
27 | |||
28 | 22 | foreach ($patterns as $pattern) { |
|
29 | 22 | $patterns[] = Str::endsWith($pattern, '/*') |
|
30 | ? Str::replaceLast('/*', '', $pattern) |
||
31 | 22 | : $pattern.'/*'; |
|
32 | } |
||
33 | |||
34 | 22 | return array_unique($patterns); |
|
35 | } |
||
36 | } |
||
37 |