| 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 | 24 | $patterns = array_map(function ($pattern) { |
|
| 25 | 6 | return trim($pattern, '/'); |
|
| 26 | 24 | }, $patterns); |
|
| 27 | |||
| 28 | 24 | foreach ($patterns as $pattern) { |
|
| 29 | 6 | $patterns[] = Str::endsWith($pattern, '/*') |
|
| 30 | 2 | ? Str::replaceLast('/*', '', $pattern) |
|
| 31 | 6 | : $pattern.'/*'; |
|
| 32 | 8 | } |
|
| 33 | |||
| 34 | 24 | return array_unique($patterns); |
|
| 35 | } |
||
| 36 | } |
||
| 37 |