/** * After invoker * * @param Joinpoint $joinpoint the concrete joinpoint * * @return mixed the result of the call to {@link Joinpoint::proceed()} */ public function invoke(Joinpoint $joinpoint) { try { $result = $joinpoint->proceed(); } finally { $adviceMethod = $this->adviceMethod; $adviceMethod($joinpoint); } return $result; }
/** * After throwing exception invoker * * @param Joinpoint $joinpoint the concrete joinpoint * * @return mixed the result of the call to {@link Joinpoint::proceed()} * @throws Exception */ public function invoke(Joinpoint $joinpoint) { try { $result = $joinpoint->proceed(); } catch (Exception $invocationException) { $adviceMethod = $this->adviceMethod; $adviceMethod($joinpoint); throw $invocationException; } return $result; }
/** * After invoker * * @param Joinpoint $joinpoint the concrete joinpoint * * @return mixed the result of the call to {@link Joinpoint::proceed()} * @throws Exception */ public final function invoke(Joinpoint $joinpoint) { $result = null; try { $result = $joinpoint->proceed(); } catch (Exception $invocationException) { // this is need for finally emulation in PHP } $adviceMethod = $this->adviceMethod; $adviceMethod($joinpoint); if (isset($invocationException)) { throw $invocationException; } return $result; }
/** * Implement this method to perform extra treatments before and * after the invocation. Polite implementations would certainly * like to invoke {@link Joinpoint::proceed()}. * * @param Joinpoint $joinpoint the method invocation joinpoint * * @return mixed the result of the call to {@link Joinpoint::proceed()} */ public function invoke(Joinpoint $joinpoint) { $this->adviceMethod->__invoke($joinpoint->getThis(), $joinpoint->getStaticPart(), $this->message, $this->level); return $joinpoint->proceed(); }
/** * Implement this method to perform extra treatments before and * after the invocation. Polite implementations would certainly * like to invoke {@link Joinpoint::proceed()}. * * @param Joinpoint $joinpoint the method invocation joinpoint * * @return mixed the result of the call to {@link Joinpoint::proceed()} */ public function invoke(Joinpoint $joinpoint) { /** @var ReflectionMethod|ReflectionProperty $reflection */ $reflection = $joinpoint->getStaticPart(); $reflectorName = 'unknown'; if ($reflection && method_exists($reflection, 'getName')) { $reflectorName = $reflection->getName(); } $this->adviceMethod->__invoke($joinpoint->getThis(), $reflectorName, $this->message, $this->level); return $joinpoint->proceed(); }
/** * Implement this method to perform extra treatments before and * after the invocation. Polite implementations would certainly * like to invoke {@link Joinpoint::proceed()}. * * @param Joinpoint $joinpoint the method invocation joinpoint * * @return mixed the result of the call to {@link Joinpoint::proceed()} */ public function invoke(Joinpoint $joinpoint) { $reflection = $joinpoint->getStaticPart(); $reflectorName = 'unknown'; if ($reflection && method_exists($reflection, 'getName')) { $reflectorName = $reflection->getName(); } $adviceMethod = $this->adviceMethod; $adviceMethod($joinpoint->getThis(), $reflectorName, $this->message, $this->level); return $joinpoint->proceed(); }