| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 36 | 123 | public static function shortcodes($shortcode): array |
|
| 37 | { |
||
| 38 | 123 | $normalized = []; |
|
| 39 | 123 | foreach (\func_get_args() as $shortcodes) { |
|
| 40 | 123 | $normalized = \array_values(\array_unique(\array_merge( |
|
| 41 | 123 | $normalized, |
|
| 42 | 123 | \array_map( |
|
| 43 | static function ($shortcode) { |
||
| 44 | 123 | return \preg_replace('/[^a-z0-9-]/', '-', \strtolower(\trim($shortcode, ':(){}[]'))); |
|
| 45 | }, |
||
| 46 | 123 | (array) $shortcodes |
|
| 47 | ) |
||
| 48 | ))); |
||
| 49 | } |
||
| 50 | |||
| 51 | 123 | return \array_unique(\array_filter($normalized)); |
|
| 52 | } |
||
| 54 |