Slide 51
Slide 51 text
rayAopBind[__FUNCTION__])) {
return call_user_func_array('parent::' . __FUNCTION__, func_get_args());
}
// proceed source method from interceptor
if (!$this->rayAopIntercept) {
$this->rayAopIntercept = true;
return call_user_func_array('parent::' . __FUNCTION__, func_get_args());
}
// proceed next interceptor
$this->rayAopIntercept = false;
$interceptors = $this->rayAopBind[__FUNCTION__];
$annotation = isset($this->rayAopBind->annotation[__FUNCTION__]) ? $this->rayAopBind
>annotation[__FUNCTION__] : null;
$invocation = new \Ray\Aop\ReflectiveMethodInvocation(array($this, __FUNCTION__),
func_get_args(), $interceptors, $annotation);
return $invocation->proceed();
}
Under the hood: Method interception sub class is created
in order enable this interception and keep type safety.