Пример #1
0
 /**
  * Invoke the state.
  *
  * @param Context $context
  * @return ResponseInterface
  */
 public function invoke(Context $context)
 {
     $context->setMutable(false);
     ob_start();
     include 'Resources/thank-you.php';
     $content = ob_get_clean();
     return new HtmlResponse(200, $content);
 }
 /**
  * Whether the state is valid.
  *
  * @param Context $context
  * @return boolean
  */
 public function isValid(Context $context)
 {
     $firstName = $context->getFirstName();
     $lastName = $context->getLastName();
     return empty($firstName) === false && empty($lastName) === false;
 }
 /**
  * Whether the state is valid.
  *
  * @param Context $context
  * @return boolean
  */
 public function isValid(Context $context)
 {
     $paymentMethod = $context->getPaymentMethod();
     return empty($paymentMethod) === false;
 }