| @@ 43-49 (lines=7) @@ | ||
| 40 | * |
|
| 41 | * @return mixed Method return. |
|
| 42 | */ |
|
| 43 | public function invokeMethod(&$object,$methodName, array $parameters = array()) |
|
| 44 | { |
|
| 45 | $reflection = new \ReflectionClass(get_class($object)); |
|
| 46 | $method = $reflection->getMethod($methodName); |
|
| 47 | $method->setAccessible(true); |
|
| 48 | return $method->invokeArgs($object, $parameters); |
|
| 49 | } |
|
| 50 | ||
| 51 | /** |
|
| 52 | * Call protected/private property of a class. |
|
| @@ 21-27 (lines=7) @@ | ||
| 18 | * |
|
| 19 | * @return mixed Method return. |
|
| 20 | */ |
|
| 21 | public function invokeMethod(&$object,$methodName, array $parameters = array()) |
|
| 22 | { |
|
| 23 | $reflection = new \ReflectionClass(get_class($object)); |
|
| 24 | $method = $reflection->getMethod($methodName); |
|
| 25 | $method->setAccessible(true); |
|
| 26 | return $method->invokeArgs($object, $parameters); |
|
| 27 | } |
|
| 28 | ||
| 29 | /** |
|
| 30 | * Call protected/private property of a class. |
|