/** * @MethodInterceptor(class-expression=.*AbstractService.*,expression=.*) */ public function profileDomainServices(MethodInvocation $invocation) { $time = microtime(true); $originalInvocation = $invocation->getOriginalInvocation(); $ret = $invocation->proceed(); $total = microtime(true) - $time; $this->logger->debug("Execution of " . $originalInvocation->getClass() . "::" . $originalInvocation->getMethod() . " took: " . sprintf('%.5f', $total)); return $ret; }
public function invoke(MethodInvocation $invocation) { try { echo "Before: " . print_r($invocation->getOriginalInvocation()) . "\n"; $invocation->proceed(array('b', 'c', 'd')); echo "After\n"; } catch (Exception $e) { echo "Move along, nothing happened here.. \n"; } }
public function invoke(MethodInvocation $invocation) { echo "Before2: " . print_r($invocation->getOriginalInvocation(), true) . "\n"; $invocation->proceed(array('b', 'c', 'd')); echo "After\n"; }