ExceptionCaster
in package
Casts common Exception classes to array representation.
Tags
Table of Contents
Properties
- $errorTypes : array<string|int, mixed>
- $srcContext : int
- $traceArgs : bool
- $framesCache : array<string|int, mixed>
Methods
- castError() : mixed
- castErrorException() : mixed
- castException() : mixed
- castFrameStub() : mixed
- castSilencedErrorContext() : mixed
- castThrowingCasterException() : mixed
- castTraceStub() : mixed
- extractSource() : EnumStub
- filterExceptionArray() : array<string|int, mixed>
- traceUnshift() : void
Properties
$errorTypes
public
static array<string|int, mixed>
$errorTypes
= [\E_DEPRECATED => 'E_DEPRECATED', \E_USER_DEPRECATED => 'E_USER_DEPRECATED', \E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR', \E_ERROR => 'E_ERROR', \E_WARNING => 'E_WARNING', \E_PARSE => 'E_PARSE', \E_NOTICE => 'E_NOTICE', \E_CORE_ERROR => 'E_CORE_ERROR', \E_CORE_WARNING => 'E_CORE_WARNING', \E_COMPILE_ERROR => 'E_COMPILE_ERROR', \E_COMPILE_WARNING => 'E_COMPILE_WARNING', \E_USER_ERROR => 'E_USER_ERROR', \E_USER_WARNING => 'E_USER_WARNING', \E_USER_NOTICE => 'E_USER_NOTICE', \E_STRICT => 'E_STRICT']
$srcContext
public
static int
$srcContext
= 1
$traceArgs
public
static bool
$traceArgs
= true
$framesCache
private
static array<string|int, mixed>
$framesCache
= []
Methods
castError()
public
static castError(Error $e, array<string|int, mixed> $a, Stub $stub, bool $isNested[, int $filter = 0 ]) : mixed
Parameters
- $e : Error
- $a : array<string|int, mixed>
- $stub : Stub
- $isNested : bool
- $filter : int = 0
castErrorException()
public
static castErrorException(ErrorException $e, array<string|int, mixed> $a, Stub $stub, bool $isNested) : mixed
Parameters
- $e : ErrorException
- $a : array<string|int, mixed>
- $stub : Stub
- $isNested : bool
castException()
public
static castException(Exception $e, array<string|int, mixed> $a, Stub $stub, bool $isNested[, int $filter = 0 ]) : mixed
Parameters
- $e : Exception
- $a : array<string|int, mixed>
- $stub : Stub
- $isNested : bool
- $filter : int = 0
castFrameStub()
public
static castFrameStub(FrameStub $frame, array<string|int, mixed> $a, Stub $stub, bool $isNested) : mixed
Parameters
castSilencedErrorContext()
public
static castSilencedErrorContext(SilencedErrorContext $e, array<string|int, mixed> $a, Stub $stub, bool $isNested) : mixed
Parameters
- $e : SilencedErrorContext
- $a : array<string|int, mixed>
- $stub : Stub
- $isNested : bool
castThrowingCasterException()
public
static castThrowingCasterException(ThrowingCasterException $e, array<string|int, mixed> $a, Stub $stub, bool $isNested) : mixed
Parameters
- $e : ThrowingCasterException
- $a : array<string|int, mixed>
- $stub : Stub
- $isNested : bool
castTraceStub()
public
static castTraceStub(TraceStub $trace, array<string|int, mixed> $a, Stub $stub, bool $isNested) : mixed
Parameters
extractSource()
private
static extractSource(string $srcLines, int $line, int $srcContext, string $lang, string|null $file, array<string|int, mixed> $frame) : EnumStub
Parameters
- $srcLines : string
- $line : int
- $srcContext : int
- $lang : string
- $file : string|null
- $frame : array<string|int, mixed>
Return values
EnumStubfilterExceptionArray()
private
static filterExceptionArray(string $xClass, array<string|int, mixed> $a, string $xPrefix, int $filter) : array<string|int, mixed>
Parameters
- $xClass : string
- $a : array<string|int, mixed>
- $xPrefix : string
- $filter : int
Return values
array<string|int, mixed>traceUnshift()
private
static traceUnshift(array<string|int, mixed> &$trace, string|null $class, string $file, int $line) : void
Parameters
- $trace : array<string|int, mixed>
- $class : string|null
- $file : string
- $line : int