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