phproxy
Class proxy for php based on java.lang.reflect.Proxy. This library is under Apache License 2.0.
PHP >= 5.5 HHVM >= 3.4.0
Usage:
use \Reflection\Proxy;
class MyInvocationHandler implements \Reflection\InvocationHandler
{
/**
* @param object $proxy
* @param string $method
* @param mixed[] $args
* @return mixed
*/
function invoke($proxy, $method, $args)
{
echo $method;
return 'my return value';
}
}
$proxy = Proxy::newProxyInstance(\stdClass::class, new MyInvocationHandler());
echo $proxy->CustomMethod();