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