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 0da5eb3 commit e838f84
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/public/AppFramework/Http/NotFoundResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,14 @@ public function __construct() {
$this->setContentSecurityPolicy(new ContentSecurityPolicy());
$this->setStatus(Http::STATUS_NOT_FOUND);
}

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

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

/**
* @inheritDoc
* @deprecated Do not use this method. It modifies the status code which you are not supposed to do on a TooManyRequestsResponse
* @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 e838f84

Please sign in to comment.