| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | 5 | public static function value( $entity, $arguments = [], $method = '__invoke' ) { |
|
| 33 | 5 | if ( is_callable( $entity ) ) { |
|
| 34 | 2 | return call_user_func_array( $entity, $arguments ); |
|
| 35 | } |
||
| 36 | |||
| 37 | 3 | if ( is_object( $entity ) ) { |
|
| 38 | 1 | return call_user_func_array( [$entity, $method], $arguments ); |
|
| 39 | } |
||
| 40 | |||
| 41 | 2 | if ( static::isClass( $entity ) ) { |
|
| 42 | 1 | return call_user_func_array( [new $entity(), $method], $arguments ); |
|
| 43 | } |
||
| 44 | |||
| 45 | 1 | return $entity; |
|
| 46 | } |
||
| 47 | |||
| 58 |