/** * @param ContextInterface $context * * @return void */ public function execute(ContextInterface $context) { try { $this->mainAction->execute($context); } catch (\Exception $ex) { /** @var ExceptionContext $exceptionContext */ $exceptionContext = $context->getSubContext(ProfileContexts::EXCEPTION, ExceptionContext::class); $exceptionContext->addException($ex); $this->errorAction->execute($context); } }
/** * @param int $depth * * @return array */ public function debugPrintTree($depth = 0) { $arr = array(); if ($this->assertionAction instanceof DebugPrintTreeActionInterface) { $arr = array_merge($arr, $this->assertionAction->debugPrintTree()); } else { $arr[get_class($this->assertionAction)] = array(); } $result = array(static::class => $arr); return $result; }
/** * @param ContextInterface $context * * @return void */ public function execute(ContextInterface $context) { $this->beforeAction($context); $this->action->execute($context); $this->afterAction($context); }