feat: add HTTPExceptionInterface and ExitExceptionInterface

This commit is contained in:
kenjis 2022-07-04 12:13:49 +09:00
parent 5901d10c29
commit f313732eb5
No known key found for this signature in database
GPG Key ID: BD254878922AF198
7 changed files with 45 additions and 5 deletions

View File

@ -11,9 +11,10 @@
namespace CodeIgniter\Database\Exceptions; namespace CodeIgniter\Database\Exceptions;
use CodeIgniter\Exceptions\HasExitCodeException;
use Error; use Error;
class DatabaseException extends Error implements ExceptionInterface class DatabaseException extends Error implements ExceptionInterface, HasExitCodeException
{ {
/** /**
* Exit status code * Exit status code

View File

@ -18,7 +18,7 @@ namespace CodeIgniter\Exceptions;
* *
* @codeCoverageIgnore * @codeCoverageIgnore
*/ */
class CastException extends CriticalError class CastException extends CriticalError implements HasExitCodeException
{ {
use DebugTraceableTrait; use DebugTraceableTrait;

View File

@ -14,7 +14,7 @@ namespace CodeIgniter\Exceptions;
/** /**
* Exception for automatic logging. * Exception for automatic logging.
*/ */
class ConfigException extends CriticalError class ConfigException extends CriticalError implements HasExitCodeException
{ {
use DebugTraceableTrait; use DebugTraceableTrait;

View File

@ -0,0 +1,19 @@
<?php
/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace CodeIgniter\Exceptions;
/**
* Interface for Exceptions that has exception code as exit code.
*/
interface ExitExceptionInterface
{
}

View File

@ -0,0 +1,19 @@
<?php
/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace CodeIgniter\Exceptions;
/**
* Interface for Exceptions that has exception code as HTTP status code.
*/
interface HTTPExceptionInterface
{
}

View File

@ -14,7 +14,7 @@ namespace CodeIgniter\Exceptions;
use Config\Services; use Config\Services;
use OutOfBoundsException; use OutOfBoundsException;
class PageNotFoundException extends OutOfBoundsException implements ExceptionInterface class PageNotFoundException extends OutOfBoundsException implements ExceptionInterface, HasHttpStatusCodeException
{ {
use DebugTraceableTrait; use DebugTraceableTrait;

View File

@ -11,12 +11,13 @@
namespace CodeIgniter\Router\Exceptions; namespace CodeIgniter\Router\Exceptions;
use CodeIgniter\Exceptions\HasHttpStatusCodeException;
use Exception; use Exception;
/** /**
* RedirectException * RedirectException
*/ */
class RedirectException extends Exception class RedirectException extends Exception implements HasHttpStatusCodeException
{ {
/** /**
* HTTP status code for redirects * HTTP status code for redirects