| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 21 | public static function call($object, $method, $parameters, $anotherObject = null) |
|
| 23 | { |
||
| 24 | 21 | $method = \Doctrine\Common\Util\Inflector::camelize($method); |
|
| 25 | 21 | $result = $object; |
|
| 26 | |||
| 27 | 21 | if (is_null($anotherObject)) { |
|
| 28 | 9 | $anotherObject = $object; |
|
| 29 | 9 | } |
|
| 30 | |||
| 31 | 21 | if (method_exists($anotherObject, $method)) { |
|
| 32 | 21 | $result = call_user_func_array([ $anotherObject, $method ], $parameters); |
|
| 33 | 21 | } |
|
| 34 | |||
| 35 | 21 | return $result; |
|
| 36 | } |
||
| 37 | } |
||
| 38 |