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