Ejemplo n.º 1
0
 /**
  * @param \ReflectionMethod[] $methods
  * @param AbstractBean $bean
  * @return array
  */
 private function getBeforeCallMethod($methods, AbstractBean $bean)
 {
     $beforeCall = [];
     foreach ($methods as $method) {
         $methodName = $method->getName();
         $beforeCall[$methodName] = function ($proxy, $instance, $method, $params, &$returnEarly) use($methodName, $bean) {
             $annotationDispatcher = new AnnotationsDispatcher($bean, $bean->getClass(), $bean->getSphringEventDispatcher());
             $annotationDispatcher->setMethodArgs($params);
             $returnValue = $annotationDispatcher->dispatchAnnotationMethodCallBefore($methodName);
             if ($returnValue !== null) {
                 $returnEarly = true;
             }
             return $returnValue;
         };
     }
     return $beforeCall;
 }