PDF rausgenommen
This commit is contained in:
23
msd2/phpBB3/vendor/ocramius/proxy-manager/examples/smart-reference.php
vendored
Normal file
23
msd2/phpBB3/vendor/ocramius/proxy-manager/examples/smart-reference.php
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use ProxyManager\Factory\AccessInterceptorValueHolderFactory;
|
||||
|
||||
class Foo
|
||||
{
|
||||
public function doFoo()
|
||||
{
|
||||
echo "Foo!\n";
|
||||
}
|
||||
}
|
||||
|
||||
$factory = new AccessInterceptorValueHolderFactory();
|
||||
|
||||
$proxy = $factory->createProxy(
|
||||
new Foo(),
|
||||
array('doFoo' => function () { echo "pre-foo!\n"; }),
|
||||
array('doFoo' => function () { echo "post-foo!\n"; })
|
||||
);
|
||||
|
||||
$proxy->doFoo();
|
Reference in New Issue
Block a user