| Conditions | 5 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | public function sanitize( $value = array() ) { |
||
| 47 | |||
| 48 | if ( is_string( $value ) || is_numeric( $value ) ) { |
||
| 49 | return array( |
||
| 50 | esc_attr( $value ), |
||
| 51 | ); |
||
| 52 | } |
||
| 53 | $sanitized_value = array(); |
||
| 54 | foreach ( $value as $sub_value ) { |
||
| 55 | if ( isset( $this->choices[ $sub_value ] ) ) { |
||
| 56 | $sanitized_value[] = esc_attr( $sub_value ); |
||
| 57 | } |
||
| 58 | } |
||
| 59 | return $sanitized_value; |
||
| 60 | |||
| 61 | } |
||
| 62 | } |
||
| 63 |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.