CodeIgniter v4.7 API

CastException extends CastException
in package

CastException is thrown for invalid cast initialization and management.

Table of Contents

Methods

__construct()  : mixed
Tweaks the exception's constructor to assign the file/line to where it is actually raised rather than were it is instantiated.
forCopyError()  : static
forEnabledZlibOutputCompression()  : static
forFabricatorCreateFailed()  : static
forInvalidDirectory()  : static
forInvalidEnumCaseName()  : static
Thrown when an invalid case name is provided for a unit enum.
forInvalidEnumType()  : static
Thrown when an enum instance of wrong type is provided.
forInvalidEnumValue()  : static
Thrown when an invalid value is provided for an enum.
forInvalidFile()  : static
forInvalidInterface()  : static
Thrown when the cast class does not extends BaseCast.
forInvalidJsonFormat()  : static
Thrown when the Json format is invalid.
forInvalidMethod()  : static
Thrown when the cast method is not `get` or `set`.
forInvalidTimestamp()  : static
Thrown when the casting timestamp is not correct timestamp.
forMissingEnumClass()  : static
Thrown when the enum class is not specified in cast parameters.
forMissingExtension()  : static
forNoHandlers()  : static
forNotEnum()  : static
Thrown when the specified class is not an enum.
getExitCode()  : int
Returns exit status code.

Methods

__construct()

Tweaks the exception's constructor to assign the file/line to where it is actually raised rather than were it is instantiated.

public final __construct([string $message = '' ][, int $code = 0 ][, Throwable|null $previous = null ]) : mixed
Parameters
$message : string = ''
$code : int = 0
$previous : Throwable|null = null

forCopyError()

public static forCopyError(string $path) : static
Parameters
$path : string
Return values
static

forEnabledZlibOutputCompression()

public static forEnabledZlibOutputCompression() : static
Return values
static

forFabricatorCreateFailed()

public static forFabricatorCreateFailed(string $table, string $reason) : static
Parameters
$table : string
$reason : string
Return values
static

forInvalidDirectory()

public static forInvalidDirectory(string $path) : static
Parameters
$path : string
Return values
static

forInvalidEnumCaseName()

Thrown when an invalid case name is provided for a unit enum.

public static forInvalidEnumCaseName(string $enumClass, string $caseName) : static
Parameters
$enumClass : string
$caseName : string
Return values
static

forInvalidEnumType()

Thrown when an enum instance of wrong type is provided.

public static forInvalidEnumType(string $expectedClass, string $actualClass) : static
Parameters
$expectedClass : string
$actualClass : string
Return values
static

forInvalidEnumValue()

Thrown when an invalid value is provided for an enum.

public static forInvalidEnumValue(string $enumClass, mixed $value) : static
Parameters
$enumClass : string
$value : mixed
Return values
static

forInvalidFile()

public static forInvalidFile(string $path) : static
Parameters
$path : string
Return values
static

forInvalidInterface()

Thrown when the cast class does not extends BaseCast.

public static forInvalidInterface(string $class) : static
Parameters
$class : string
Return values
static

forInvalidJsonFormat()

Thrown when the Json format is invalid.

public static forInvalidJsonFormat(int $error) : static
Parameters
$error : int
Return values
static

forInvalidMethod()

Thrown when the cast method is not `get` or `set`.

public static forInvalidMethod(string $method) : static
Parameters
$method : string
Return values
static

forInvalidTimestamp()

Thrown when the casting timestamp is not correct timestamp.

public static forInvalidTimestamp() : static
Return values
static

forMissingEnumClass()

Thrown when the enum class is not specified in cast parameters.

public static forMissingEnumClass() : static
Return values
static

forMissingExtension()

public static forMissingExtension(string $extension) : static

No longer used.

Parameters
$extension : string
Return values
static

forNoHandlers()

public static forNoHandlers(string $class) : static
Parameters
$class : string
Return values
static

forNotEnum()

Thrown when the specified class is not an enum.

public static forNotEnum(string $class) : static
Parameters
$class : string
Return values
static

getExitCode()

Returns exit status code.

public getExitCode() : int
Return values
int

        
On this page

Search results