Conditions | 8 |
Paths | 12 |
Total Lines | 29 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | protected function process_output( $output, $value ) { |
||
25 | $output = wp_parse_args( |
||
26 | $output, array( |
||
|
|||
27 | 'element' => '', |
||
28 | 'property' => '', |
||
29 | 'media_query' => 'global', |
||
30 | 'prefix' => '', |
||
31 | 'suffix' => '', |
||
32 | ) |
||
33 | ); |
||
34 | |||
35 | if ( ! is_array( $value ) ) { |
||
36 | return; |
||
37 | } |
||
38 | |||
39 | foreach ( array_keys( $value ) as $key ) { |
||
40 | |||
41 | $property = ( empty( $output['property'] ) ) ? $key : $output['property'] . '-' . $key; |
||
42 | if ( isset( $output['choice'] ) && $output['property'] ) { |
||
43 | if ( $key === $output['choice'] ) { |
||
44 | $property = $output['property']; |
||
45 | } else { |
||
46 | continue; |
||
47 | } |
||
48 | } |
||
49 | if ( false !== strpos( $output['property'], '%%' ) ) { |
||
50 | $property = str_replace( '%%', $key, $output['property'] ); |
||
51 | } |
||
52 | $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $this->process_property_value( $property, $value[ $key ] ) . $output['suffix']; |
||
53 | } |
||
56 |
For a function calls that spawns multiple lines, the coding style suggests to split arguments to separate lines like this: