| Conditions | 4 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 39 | public static function value( $entity, $arguments = [], $method = null ) { |
||
| 40 | if ( is_callable( $entity ) ) { |
||
| 41 | return call_user_func_array( $entity, $arguments ); |
||
| 42 | } |
||
| 43 | |||
| 44 | if ( is_string( $entity ) && class_exists( $entity ) ) { |
||
| 45 | $instance = new $entity(); |
||
| 46 | return call_user_func_array( [$instance, $method], $arguments ); |
||
| 47 | } |
||
| 48 | |||
| 49 | return call_user_func_array( [$entity, $method], $arguments ); |
||
| 50 | } |
||
| 51 | } |
||
| 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.