Skip to content

Commit 46606c4

Browse files
committed
uses IResponse constants
1 parent baf20c4 commit 46606c4

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/Application/UI/Component.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,10 @@ public function redirectPermanent($destination = NULL, $args = [])
371371
{
372372
$args = func_num_args() < 3 && is_array($args) ? $args : array_slice(func_get_args(), 1);
373373
$presenter = $this->getPresenter();
374-
$presenter->redirectUrl($presenter->createRequest($this, $destination, $args, 'redirect'), 301);
374+
$presenter->redirectUrl(
375+
$presenter->createRequest($this, $destination, $args, 'redirect'),
376+
Nette\Http\IResponse::S301_MOVED_PERMANENTLY
377+
);
375378
}
376379

377380

src/Application/exceptions.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
namespace Nette\Application;
99

10+
use Nette\Http\IResponse;
11+
1012

1113
/**
1214
* The exception that is thrown when user attempts to terminate the current presenter or application.
@@ -39,7 +41,7 @@ class InvalidPresenterException extends \Exception
3941
class BadRequestException extends \Exception
4042
{
4143
/** @var int */
42-
protected $code = 404;
44+
protected $code = IResponse::S404_NOT_FOUND;
4345

4446

4547
public function __construct($message = '', $httpCode = 0, \Exception $previous = NULL)
@@ -65,6 +67,6 @@ public function getHttpCode()
6567
class ForbiddenRequestException extends BadRequestException
6668
{
6769
/** @var int */
68-
protected $code = 403;
70+
protected $code = IResponse::S403_FORBIDDEN;
6971

7072
}

0 commit comments

Comments
 (0)