Skip to content

Commit 0891ccc

Browse files
committed
refactor: moving RedirectException.
1 parent 11b585b commit 0891ccc

File tree

9 files changed

+37
-8
lines changed

9 files changed

+37
-8
lines changed

system/CodeIgniter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
use CodeIgniter\Exceptions\PageNotFoundException;
1919
use CodeIgniter\HTTP\CLIRequest;
2020
use CodeIgniter\HTTP\DownloadResponse;
21+
use CodeIgniter\HTTP\Exceptions\RedirectException;
2122
use CodeIgniter\HTTP\IncomingRequest;
2223
use CodeIgniter\HTTP\RedirectResponse;
2324
use CodeIgniter\HTTP\Request;
2425
use CodeIgniter\HTTP\ResponseInterface;
2526
use CodeIgniter\HTTP\URI;
26-
use CodeIgniter\Router\Exceptions\RedirectException;
2727
use CodeIgniter\Router\RouteCollectionInterface;
2828
use CodeIgniter\Router\Router;
2929
use Config\App;

system/Commands/Utilities/Routes/FilterFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use CodeIgniter\Exceptions\PageNotFoundException;
1515
use CodeIgniter\Filters\Filters;
16-
use CodeIgniter\Router\Exceptions\RedirectException;
16+
use CodeIgniter\HTTP\Exceptions\RedirectException;
1717
use CodeIgniter\Router\Router;
1818
use Config\Services;
1919

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
/**
4+
* This file is part of CodeIgniter 4 framework.
5+
*
6+
* (c) CodeIgniter Foundation <[email protected]>
7+
*
8+
* For the full copyright and license information, please view
9+
* the LICENSE file that was distributed with this source code.
10+
*/
11+
12+
namespace CodeIgniter\HTTP\Exceptions;
13+
14+
use CodeIgniter\Exceptions\HTTPExceptionInterface;
15+
use Exception;
16+
17+
/**
18+
* RedirectException
19+
*/
20+
class RedirectException extends Exception implements HTTPExceptionInterface
21+
{
22+
/**
23+
* HTTP status code for redirects
24+
*
25+
* @var int
26+
*/
27+
protected $code = 302;
28+
}

system/Router/Exceptions/RedirectException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
/**
1818
* RedirectException
19+
*
20+
* @deprecated Use \CodeIgniter\HTTP\Exceptions\RedirectException instead
1921
*/
2022
class RedirectException extends Exception implements HTTPExceptionInterface
2123
{

system/Router/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
use Closure;
1515
use CodeIgniter\Exceptions\PageNotFoundException;
16+
use CodeIgniter\HTTP\Exceptions\RedirectException;
1617
use CodeIgniter\HTTP\Request;
17-
use CodeIgniter\Router\Exceptions\RedirectException;
1818
use CodeIgniter\Router\Exceptions\RouterException;
1919

2020
/**

system/Test/FeatureTestCase.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
namespace CodeIgniter\Test;
1313

1414
use CodeIgniter\Events\Events;
15+
use CodeIgniter\HTTP\Exceptions\RedirectException;
1516
use CodeIgniter\HTTP\IncomingRequest;
1617
use CodeIgniter\HTTP\Request;
1718
use CodeIgniter\HTTP\URI;
1819
use CodeIgniter\HTTP\UserAgent;
19-
use CodeIgniter\Router\Exceptions\RedirectException;
20-
use CodeIgniter\Router\RouteCollection;
2120
use Config\Services;
2221
use Exception;
2322
use ReflectionException;

system/Test/FeatureTestTrait.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
namespace CodeIgniter\Test;
1313

1414
use CodeIgniter\Events\Events;
15+
use CodeIgniter\HTTP\Exceptions\RedirectException;
1516
use CodeIgniter\HTTP\IncomingRequest;
1617
use CodeIgniter\HTTP\Request;
1718
use CodeIgniter\HTTP\URI;
18-
use CodeIgniter\Router\Exceptions\RedirectException;
19-
use CodeIgniter\Router\RouteCollection;
2019
use Config\App;
2120
use Config\Services;
2221
use Exception;

tests/system/Router/RouterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
use CodeIgniter\Config\Services;
1515
use CodeIgniter\Exceptions\PageNotFoundException;
16+
use CodeIgniter\HTTP\Exceptions\RedirectException;
1617
use CodeIgniter\HTTP\IncomingRequest;
17-
use CodeIgniter\Router\Exceptions\RedirectException;
1818
use CodeIgniter\Router\Exceptions\RouterException;
1919
use CodeIgniter\Test\CIUnitTestCase;
2020
use Config\Modules;

user_guide_src/source/changelogs/v4.4.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ Deprecations
143143
``ExceptionHandler``.
144144
- **Autoloader:** ``Autoloader::sanitizeFilename()`` is deprecated.
145145
- **CodeIgniter:** ``CodeIgniter::$returnResponse`` property is deprecated. No longer used.
146+
- **RedirectException:** ``\CodeIgniter\Router\Exceptions\RedirectException`` is deprecated. Use \CodeIgniter\HTTP\Exceptions\RedirectException instead.
146147

147148
Bugs Fixed
148149
**********

0 commit comments

Comments
 (0)