Skip to content

Commit e3a1ef7

Browse files
committed
refactoring
1 parent 13ef283 commit e3a1ef7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/Application/UI/Component.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,10 @@ public function redirectPermanent(string $destination, $args = []): void
341341
{
342342
$args = func_num_args() < 3 && is_array($args) ? $args : array_slice(func_get_args(), 1);
343343
$presenter = $this->getPresenter();
344-
$presenter->redirectUrl($presenter->createRequest($this, $destination, $args, 'redirect'), 301);
344+
$presenter->redirectUrl(
345+
$presenter->createRequest($this, $destination, $args, 'redirect'),
346+
Nette\Http\IResponse::S301_MOVED_PERMANENTLY
347+
);
345348
}
346349

347350

src/Application/exceptions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class InvalidPresenterException extends \Exception
4141
class BadRequestException extends \Exception
4242
{
4343
/** @var int */
44-
protected $code = 404;
44+
protected $code = Nette\Http\IResponse::S404_NOT_FOUND;
4545

4646

4747
public function __construct(string $message = '', int $code = 0, \Exception $previous = NULL)
@@ -58,6 +58,6 @@ public function __construct(string $message = '', int $code = 0, \Exception $pre
5858
class ForbiddenRequestException extends BadRequestException
5959
{
6060
/** @var int */
61-
protected $code = 403;
61+
protected $code = Nette\Http\IResponse::S403_FORBIDDEN;
6262

6363
}

0 commit comments

Comments
 (0)