actionFlag = $actionFlag; $this->encoder = $encoder; $this->config = $config; } /** * Handle reCaptcha failure * @param ResponseInterface $response * @return void */ public function execute(ResponseInterface $response = null) { $this->actionFlag->set('', Action::FLAG_NO_DISPATCH, true); $jsonPayload = $this->encoder->encode([ 'errors' => true, 'message' => $this->config->getErrorDescription(), ]); $response->representJson($jsonPayload); } }