Skip to content

Commit b998e4d

Browse files
committed
refactoring
1 parent 13ef283 commit b998e4d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/Application/UI/Component.php

+4-1
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

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
namespace Nette\Application;
1111

12+
use Nette\Http\IResponse;
13+
1214

1315
/**
1416
* The exception that is thrown when user attempts to terminate the current presenter or application.
@@ -41,7 +43,7 @@ class InvalidPresenterException extends \Exception
4143
class BadRequestException extends \Exception
4244
{
4345
/** @var int */
44-
protected $code = 404;
46+
protected $code = IResponse::S404_NOT_FOUND;
4547

4648

4749
public function __construct(string $message = '', int $code = 0, \Exception $previous = NULL)
@@ -58,6 +60,6 @@ public function __construct(string $message = '', int $code = 0, \Exception $pre
5860
class ForbiddenRequestException extends BadRequestException
5961
{
6062
/** @var int */
61-
protected $code = 403;
63+
protected $code = IResponse::S403_FORBIDDEN;
6264

6365
}

0 commit comments

Comments
 (0)