public function toResponse() { $response = parent::toResponse(); $response->setHeader('Content-Type', 'application/xml; charset="utf-8"'); $response->setEntity(function (StreamInterface $stream) { $xml = new XmlStreamWriter(new StreamWrapper($stream)); $xml->registerNamespace(WebDav::NS_DAV, 'D'); $xml->startDocument(); $xml->startElement(WebDav::NS_DAV, 'error'); $this->toXml($xml); $xml->endElement(); // D:error $xml->endDocument(); $xml->flush(); }); return $response; }
public function __construct($status = NULL, \Exception $cause = NULL) { $status = $status === NULL ? WebDav::CODE_INTERNAL_SERVER_ERROR : $status; parent::__construct($status, $cause); $this->message = WebDav::getReason($status); }
public function __construct(\Exception $cause = NULL) { parent::__construct(Http::CODE_NOT_FOUND, $cause); }
public function toResponse() { $response = parent::toResponse(); $response->setEntity($this->entity); return $response; }
public function __construct(HttpResponse $response, \Exception $cause = NULL) { parent::__construct($response->getStatus(), $cause); $this->response = $response; }
public function toResponse() { $response = parent::toResponse(); $response->setHeader(new AllowHeader($this->allow)); return $response; }
public function __construct(\Exception $cause = NULL) { parent::__construct(Http::CODE_BAD_REQUEST, $cause); }