-
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -280,17 +280,17 @@ public function isLinkCurrent(string $destination = null, $args = []): bool | |
* @param array|mixed $args | ||
* @throws Nette\Application\AbortException | ||
*/ | ||
public function redirect($code, $destination = null, $args = []): void | ||
public function redirect(/*int $code, string */$destination, $args = []): void | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
JanGalek
Contributor
|
||
{ | ||
if (is_numeric($code)) { | ||
if (is_numeric($destination)) { | ||
trigger_error(__METHOD__ . '() first parameter $code is deprecated; use redirectPermanent() for 301 redirect.', E_USER_DEPRECATED); | ||
[$code, $destination, $args] = func_get_args() + [null, null, []]; | ||
if (func_num_args() > 3 || !is_array($args)) { | ||
$args = array_slice(func_get_args(), 2); | ||
} | ||
} elseif (!is_numeric($code)) { // first parameter is optional | ||
$args = func_num_args() < 3 && is_array($destination) ? $destination : array_slice(func_get_args(), 1); | ||
$destination = $code; | ||
} else { | ||
$code = null; | ||
$args = func_num_args() < 3 && is_array($args) ? $args : array_slice(func_get_args(), 1); | ||
} | ||
|
||
$presenter = $this->getPresenter(); | ||
|
BC break :)