Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
22 | 1 | public static function flip() { |
|
23 | 1 | $arguments = func_get_args(); |
|
24 | 1 | $first_null = array_search( null, $arguments, true ); |
|
25 | |||
26 | 1 | if ( $first_null === false ) { |
|
27 | 1 | return $arguments; |
|
28 | } |
||
29 | |||
30 | // Support integer keys only. |
||
31 | 1 | $first_null = (int) $first_null; |
|
32 | |||
33 | 1 | $arguments = array_values( array_merge( |
|
34 | 1 | array_slice( $arguments, $first_null ), |
|
35 | 1 | array_slice( $arguments, 0, $first_null ) |
|
36 | ) ); |
||
37 | |||
38 | 1 | return $arguments; |
|
39 | } |
||
41 |