| Conditions | 5 |
| Paths | 4 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public static function toArray( $argument, $check_for_callable = false ) { |
||
| 16 | if ( $check_for_callable && is_array( $argument ) && is_callable( $argument ) ) { |
||
| 17 | $argument = [$argument]; |
||
| 18 | } |
||
| 19 | |||
| 20 | if ( ! is_array( $argument ) ) { |
||
| 21 | $argument = [$argument]; |
||
| 22 | } |
||
| 23 | |||
| 24 | return $argument; |
||
| 25 | } |
||
| 26 | |||
| 52 |
This check looks for
@paramannotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.