Skip to content

Commit

Permalink
Presenter: Add return never typehint. (#291) (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek committed Jul 7, 2021
1 parent 3cde3b7 commit 59148e7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Application/UI/Presenter.php
Expand Up @@ -409,6 +409,7 @@ public function setLayout(string|bool $layout): static

/**
* @throws Nette\Application\AbortException
* @return never
*/
public function sendTemplate(Template $template = null): void
{
Expand Down Expand Up @@ -552,6 +553,7 @@ public function isAjax(): bool
/**
* Sends AJAX payload to the output.
* @throws Nette\Application\AbortException
* @return never
*/
public function sendPayload(): void
{
Expand All @@ -562,6 +564,7 @@ public function sendPayload(): void
/**
* Sends JSON data to the output.
* @throws Nette\Application\AbortException
* @return never
*/
public function sendJson(mixed $data): void
{
Expand All @@ -575,6 +578,7 @@ public function sendJson(mixed $data): void
/**
* Sends response and terminates presenter.
* @throws Nette\Application\AbortException
* @return never
*/
public function sendResponse(Application\Response $response): void
{
Expand All @@ -586,6 +590,7 @@ public function sendResponse(Application\Response $response): void
/**
* Correctly terminates presenter.
* @throws Nette\Application\AbortException
* @return never
*/
public function terminate(): void
{
Expand All @@ -597,6 +602,7 @@ public function terminate(): void
* Forward to another presenter or action.
* @param array|mixed $args
* @throws Nette\Application\AbortException
* @return never
*/
public function forward(string|Nette\Application\Request $destination, $args = []): void
{
Expand All @@ -615,6 +621,7 @@ public function forward(string|Nette\Application\Request $destination, $args = [
/**
* Redirect to another URL and ends presenter execution.
* @throws Nette\Application\AbortException
* @return never
*/
public function redirectUrl(string $url, int $httpCode = null): void
{
Expand Down

0 comments on commit 59148e7

Please sign in to comment.