Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class foo EXTENDS \ILLI\Base\aBase
- {
- private $a;
- public function setAdapter($trigger, $target, $instance)
- {
- $config = new \ILLI\Base\Component\Delegate\sConfigConstructMethod;
- $config->Context = $instance;
- $config->functionName = $target;
- $adapter = new \ILLI\Base\Component\Delegate\Hook\sConcreteAdapter;
- $adapter->triggerMethodName = get_called_class().'::'.$trigger;
- $adapter->Delegate = new \ILLI\Base\Component\Delegate\Method($config);
- $this->tAdapterHook_register($adapter);
- $this->a = TRUE;
- return $this;
- }
- public function baz($__hello)
- {
- if(TRUE === $this->a)
- return $this->tAdapterHook_emit(__METHOD__, ['__world' => $__hello]); // strict parameters!
- var_dump(__METHOD__);
- var_dump($__hello);
- return $this;
- }
- }
- class delTarget
- {
- public function target($__world)
- {
- var_dump(__METHOD__);
- var_dump($__world.' World!');
- }
- }
- $foo = new foo;
- $foo->baz('Hello')
- ->setAdapter('baz', 'target', new delTarget)
- ->baz('Hi');
- var_dump($foo);
- Output:
- string(29) "localhost\illiFW\dev\foo::baz"
- string(5) "Hello"
- string(38) "localhost\illiFW\dev\delTarget::target"
- string(9) "Hi World!"
- object(localhost\illiFW\dev\foo)#18 (12) {
- ["a"]=>
- bool(true)
- ["__runtimeConfig":protected]=>
- &array(0) {
- }
- ["__defaultConfig":protected]=>
- array(0) {
- }
- ["__autoConfig":protected]=>
- array(0) {
- }
- ["__methodFilters":protected]=>
- array(0) {
- }
- ["__tBase_autoConfig":"ILLI\Base\aBase":private]=>
- array(0) {
- }
- ["__tBase_initConfig":"ILLI\Base\aBase":private]=>
- array(1) {
- ["__init"]=>
- bool(true)
- }
- ["__tBase_defaultConfig":"ILLI\Base\aBase":private]=>
- array(0) {
- }
- ["__tBase_runtimeConfig":"ILLI\Base\aBase":private]=>
- &array(0) {
- }
- ["__tAdapterHook_hook":protected]=>
- array(1) {
- ["localhost\illiFW\dev\foo::baz"]=>
- object(ILLI\Base\Component\Delegate\Hook\sConcreteAdapter)#32 (4) {
- ["__tStructure_MemberFields":protected]=>
- array(2) {
- [0]=>
- string(17) "triggerMethodName"
- [1]=>
- string(8) "Delegate"
- }
- ["__tStructure_MemberProperties":protected]=>
- array(2) {
- ["triggerMethodName"]=>
- array(5) {
- ["init"]=>
- NULL
- ["contains"]=>
- string(29) "localhost\illiFW\dev\foo::baz"
- ["isTouched"]=>
- bool(true)
- ["flag"]=>
- int(4)
- ["typeOf"]=>
- array(1) {
- [0]=>
- string(6) "string"
- }
- }
- ["Delegate"]=>
- array(5) {
- ["init"]=>
- NULL
- ["contains"]=>
- object(ILLI\Base\Component\Delegate\Method)#38 (3) {
- ["__sInvokable":protected]=>
- object(ILLI\Base\Component\Delegate\sConfigConstructMethod)#26 (4) {
- ["__tStructure_MemberFields":protected]=>
- array(9) {
- [0]=>
- string(9) "className"
- [1]=>
- string(12) "functionName"
- [2]=>
- string(15) "strictArguments"
- [3]=>
- string(16) "defaultArguments"
- [4]=>
- string(7) "Context"
- [5]=>
- string(18) "ContextConstructor"
- [6]=>
- string(16) "contextArguments"
- [7]=>
- string(10) "methodName"
- [8]=>
- string(11) "methodArray"
- }
- ["__tStructure_MemberProperties":protected]=>
- array(9) {
- ["className"]=>
- array(5) {
- ["init"]=>
- NULL
- ["contains"]=>
- string(30) "localhost\illiFW\dev\delTarget"
- ["isTouched"]=>
- bool(true)
- ["flag"]=>
- int(4)
- ["typeOf"]=>
- array(1) {
- [0]=>
- string(6) "string"
- }
- }
- ["functionName"]=>
- array(5) {
- ["init"]=>
- NULL
- ["contains"]=>
- string(6) "target"
- ["isTouched"]=>
- bool(true)
- ["flag"]=>
- int(4)
- ["typeOf"]=>
- array(1) {
- [0]=>
- string(6) "string"
- }
- }
- ["strictArguments"]=>
- array(5) {
- ["init"]=>
- bool(true)
- ["contains"]=>
- bool(true)
- ["isTouched"]=>
- bool(false)
- ["flag"]=>
- int(0)
- ["typeOf"]=>
- array(1) {
- [0]=>
- string(7) "boolean"
- }
- }
- ["defaultArguments"]=>
- array(5) {
- ["init"]=>
- array(0) {
- }
- ["contains"]=>
- array(0) {
- }
- ["isTouched"]=>
- bool(false)
- ["flag"]=>
- int(0)
- ["typeOf"]=>
- array(1) {
- [0]=>
- string(5) "array"
- }
- }
- ["Context"]=>
- array(5) {
- ["init"]=>
- NULL
- ["contains"]=>
- object(localhost\illiFW\dev\delTarget)#19 (0) {
- }
- ["isTouched"]=>
- bool(true)
- ["flag"]=>
- int(0)
- ["typeOf"]=>
- array(1) {
- [0]=>
- string(6) "object"
- }
- }
- ["ContextConstructor"]=>
- array(5) {
- ["init"]=>
- NULL
- ["contains"]=>
- NULL
- ["isTouched"]=>
- bool(false)
- ["flag"]=>
- int(0)
- ["typeOf"]=>
- array(1) {
- [0]=>
- string(39) "ILLI\Base\Component\Invoke\sConstructor"
- }
- }
- ["contextArguments"]=>
- array(5) {
- ["init"]=>
- array(0) {
- }
- ["contains"]=>
- array(0) {
- }
- ["isTouched"]=>
- bool(false)
- ["flag"]=>
- int(0)
- ["typeOf"]=>
- array(1) {
- [0]=>
- string(5) "array"
- }
- }
- ["methodName"]=>
- array(6) {
- ["init"]=>
- NULL
- ["contains"]=>
- NULL
- ["isTouched"]=>
- bool(false)
- ["flag"]=>
- int(10)
- ["typeOf"]=>
- array(1) {
- [0]=>
- string(6) "string"
- }
- ["onGet"]=>
- array(1) {
- [0]=>
- object(Closure)#29 (1) {
- ["this"]=>
- *RECURSION*
- }
- }
- }
- ["methodArray"]=>
- array(6) {
- ["init"]=>
- array(0) {
- }
- ["contains"]=>
- array(0) {
- }
- ["isTouched"]=>
- bool(false)
- ["flag"]=>
- int(10)
- ["typeOf"]=>
- array(1) {
- [0]=>
- string(5) "array"
- }
- ["onGet"]=>
- array(1) {
- [0]=>
- object(Closure)#30 (1) {
- ["this"]=>
- *RECURSION*
- }
- }
- }
- }
- ["__tStructure_Locked":protected]=>
- bool(false)
- ["__tStructure_MemberFieldValid":protected]=>
- bool(false)
- }
- ["__parameters":protected]=>
- array(1) {
- ["__world"]=>
- string(2) "Hi"
- }
- ["__result":protected]=>
- NULL
- }
- ["isTouched"]=>
- bool(true)
- ["flag"]=>
- int(4)
- ["typeOf"]=>
- array(1) {
- [0]=>
- string(44) "ILLI\Base\Component\Delegate\aMethodDelegate"
- }
- }
- }
- ["__tStructure_Locked":protected]=>
- bool(false)
- ["__tStructure_MemberFieldValid":protected]=>
- bool(false)
- }
- }
- ["__tSignalHook_hook":protected]=>
- array(0) {
- }
- ["__tSignalHook_results":protected]=>
- array(0) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement