diff --git a/system/Exceptions/CastException.php b/system/Exceptions/CastException.php deleted file mode 100644 index 139c1c5fc725..000000000000 --- a/system/Exceptions/CastException.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace CodeIgniter\Exceptions; - -/** - * Cast Exceptions. - * - * @deprecated use CodeIgniter\Entity\Exceptions\CastException instead. - * - * @codeCoverageIgnore - */ -class CastException extends CriticalError implements HasExitCodeInterface -{ - use DebugTraceableTrait; - - public function getExitCode(): int - { - return EXIT_CONFIG; - } - - /** - * @return static - */ - public static function forInvalidJsonFormatException(int $error) - { - switch ($error) { - case JSON_ERROR_DEPTH: - return new static(lang('Cast.jsonErrorDepth')); - - case JSON_ERROR_STATE_MISMATCH: - return new static(lang('Cast.jsonErrorStateMismatch')); - - case JSON_ERROR_CTRL_CHAR: - return new static(lang('Cast.jsonErrorCtrlChar')); - - case JSON_ERROR_SYNTAX: - return new static(lang('Cast.jsonErrorSyntax')); - - case JSON_ERROR_UTF8: - return new static(lang('Cast.jsonErrorUtf8')); - - default: - return new static(lang('Cast.jsonErrorUnknown')); - } - } -} diff --git a/user_guide_src/source/changelogs/v4.5.0.rst b/user_guide_src/source/changelogs/v4.5.0.rst index 52c49500fe91..55a5e6cfaad7 100644 --- a/user_guide_src/source/changelogs/v4.5.0.rst +++ b/user_guide_src/source/changelogs/v4.5.0.rst @@ -223,6 +223,7 @@ Others - **Config:** The deprecated ``CodeIgniter\Config\Config`` class has been removed. - **Controller:** The deprecated ``Controller::loadHelpers()`` method has been removed. +- **Exceptions:** The deprecated ``CodeIgniter\Exceptions\CastException`` class has been removed. Enhancements ************