/** * @param Command $command * @param UnitOfWork $unitOfWork * @param InterceptorChain $interceptorChain * * @return mixed The result of the command handler, if any. */ public function handle(Command $command, UnitOfWork $unitOfWork, InterceptorChain $interceptorChain) { $auditListener = new AuditUnitOfWorkListener($command, $this->auditDataProvider, $this->auditLogger); $unitOfWork->registerListener($auditListener); $result = $interceptorChain->proceed(); $auditListener->setResult($result); return $result; }