crashuxx / phproxy
Class proxy
Installs: 6 007
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 3
Open Issues: 0
Requires (Dev)
- phpunit/phpunit: ~4.3
This package is not auto-updated.
Last update: 2024-12-21 17:27:51 UTC
README
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();