| 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 |
||
| 32 | public static function value( $entity, $arguments = [], $method = '__invoke' ) { |
||
| 33 | if ( is_callable( $entity ) ) { |
||
| 34 | return call_user_func_array( $entity, $arguments ); |
||
| 35 | } |
||
| 36 | |||
| 37 | if ( is_string( $entity ) && class_exists( $entity ) ) { |
||
| 38 | $instance = new $entity(); |
||
| 39 | return call_user_func_array( [$instance, $method], $arguments ); |
||
| 40 | } |
||
| 41 | |||
| 42 | return call_user_func_array( [$entity, $method], $arguments ); |
||
| 43 | } |
||
| 44 | } |
||
| 45 |