Conditions | 5 |
Paths | 2 |
Total Lines | 35 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function valueProvider( $stringlyTyped = true ) { |
||
29 | $values = [ |
||
30 | 'empty' => [ |
||
31 | [ 'yes', true, true ], |
||
32 | [ 'on', true, true ], |
||
33 | [ '1', true, true ], |
||
34 | [ 'no', true, false ], |
||
35 | [ 'off', true, false ], |
||
36 | [ '0', true, false ], |
||
37 | [ 'foobar', false ], |
||
38 | [ '2', false ], |
||
39 | [ [], false ], |
||
40 | [ 42, false ], |
||
41 | ], |
||
42 | 'values' => [], |
||
43 | // 'values' => array( |
||
44 | // array( '1', true, true ), |
||
45 | // array( 'yes', true, true ), |
||
46 | // array( 'no', false ), |
||
47 | // array( 'foobar', false ), |
||
48 | // ), |
||
49 | ]; |
||
50 | |||
51 | if ( !$stringlyTyped ) { |
||
52 | foreach ( $values as &$set ) { |
||
53 | foreach ( $set as &$value ) { |
||
54 | if ( in_array( $value[0], [ 'yes', 'on', '1', '0', 'off', 'no' ], true ) ) { |
||
55 | $value[0] = in_array( $value[0], [ 'yes', 'on', '1' ], true ); |
||
56 | } |
||
57 | } |
||
58 | } |
||
59 | } |
||
60 | |||
61 | return $values; |
||
62 | } |
||
63 | |||
73 |