/** * @param string $error Short name of the error * @param string $error_description Description of the error * @param array $error_data Data to add to the error * @param array $data Additional data sent to the exception */ public function __construct($error, $error_description, array $error_data, array $data) { parent::__construct(302, $error, $error_description, $error_data); Assertion::keyExists($data, 'redirect_uri', 'redirect_uri_not_defined'); Assertion::keyExists($data, 'response_mode', 'invalid_response_mode'); Assertion::isInstanceOf($data['response_mode'], ResponseModeInterface::class, 'invalid_response_mode'); $this->response_mode = $data['response_mode']; $this->redirect_uri = $data['redirect_uri']; if (array_key_exists('state', $data) && null !== $data['state']) { $this->errorData['state'] = $data['state']; } }
/** * @param string $error Short name of the error * @param string $error_description Description of the error (optional) * @param string $error_uri Uri of the error (optional) * @param array $data Additional data sent to the exception (optional) * * @throws \InvalidArgumentException */ public function __construct($error, $error_description = null, $error_uri = null, array $data = []) { parent::__construct(302, $error, $error_description, $error_uri); if (!array_key_exists('redirect_uri', $data)) { throw new \InvalidArgumentException('redirect_uri_not_defined'); } if (!array_key_exists('transport_mode', $data) || !in_array($data['transport_mode'], ['query', 'fragment'])) { throw new \InvalidArgumentException('invalid_transport_mode'); } $this->transport_mode = $data['transport_mode']; $this->redirect_uri = $data['redirect_uri']; if (array_key_exists('state', $data) && null !== $data['state']) { $this->errorData['state'] = $data['state']; } }
/** * @param string $error Short name of the error * @param string $error_description Description of the error * @param array $error_data Data to add to the error * @param array $data Additional data sent to the exception */ public function __construct($error, $error_description, array $error_data, array $data) { parent::__construct(403, $error, $error_description, $error_data); }