Skip to content

Commit

Permalink
Deprecate setStatus method for Responses with a fixed status code
Browse files Browse the repository at this point in the history
Signed-off-by: jld3103 <[email protected]>
  • Loading branch information
provokateurin committed Jun 26, 2023
1 parent e8da9eb commit 83f6338
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/public/AppFramework/Http/NotFoundResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,15 @@ public function __construct() {
$this->setContentSecurityPolicy(new ContentSecurityPolicy());
$this->setStatus(Http::STATUS_NOT_FOUND);
}

/**
* @inheritDoc
* @deprecated 28.0.0 Do not use this method. It modifies the status code which you are not supposed to do on a NotFoundResponse
* @internal
* @since 6.0.0 - return value was added in 7.0.0
*/
public function setStatus($status): static {
parent::setStatus($status);
return $this;
}
}
11 changes: 11 additions & 0 deletions lib/public/AppFramework/Http/RedirectResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,15 @@ public function __construct($redirectURL) {
public function getRedirectURL() {
return $this->redirectURL;
}

/**
* @inheritDoc
* @deprecated 28.0.0 Do not use this method. It modifies the status code which you are not supposed to do on a RedirectResponse
* @internal
* @since 6.0.0 - return value was added in 7.0.0
*/
public function setStatus($status): static {
parent::setStatus($status);
return $this;
}
}
11 changes: 11 additions & 0 deletions lib/public/AppFramework/Http/TooManyRequestsResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,15 @@ public function render() {
$template = new Template('core', '429', 'blank');
return $template->fetchPage();
}

/**
* @inheritDoc
* @deprecated 28.0.0 Do not use this method. It modifies the status code which you are not supposed to do on a TooManyRequestsResponse
* @internal
* @since 6.0.0 - return value was added in 7.0.0
*/
public function setStatus($status): static {
parent::setStatus($status);
return $this;
}
}

0 comments on commit 83f6338

Please sign in to comment.