Пример #1
0
 /**
  * @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);
     }
 }
Пример #2
0
 /**
  * @param ProfileContext $context
  */
 protected function doExecute(ProfileContext $context)
 {
     $response = MessageContextHelper::asResponse($context->getInboundContext());
     foreach ($response->getAllAssertions() as $index => $assertion) {
         $name = sprintf('assertion_%s', $index);
         /** @var AssertionContext $assertionContext */
         $assertionContext = $context->getSubContext($name, AssertionContext::class);
         $assertionContext->setAssertion($assertion)->setId($name);
         $this->assertionAction->execute($assertionContext);
     }
 }
Пример #3
0
 /**
  * @param ContextInterface $context
  *
  * @return void
  */
 public function execute(ContextInterface $context)
 {
     $this->beforeAction($context);
     $this->action->execute($context);
     $this->afterAction($context);
 }