W3cubDocs

/Symfony 4.1

FlattenException

class FlattenException

FlattenException wraps a PHP Error or Exception to be able to serialize it.

Basically, this class removes all objects from the trace.

Methods

static create(Exception $exception, $statusCode = null, array $headers = array())
static FlattenException createFromThrowable(Throwable $exception, int|null $statusCode = null, array $headers = array())
toArray()
getStatusCode()
setStatusCode($code)
getHeaders()
setHeaders(array $headers)
getClass()
setClass($class)
getFile()
setFile($file)
getLine()
setLine($line)
getMessage()
setMessage($message)
getCode()
setCode($code)
getPrevious()
setPrevious(FlattenException $previous)
getAllPrevious()
getTrace()
setTraceFromException(Exception $exception) deprecated
void setTraceFromThrowable(Throwable $throwable)
setTrace($trace, $file, $line)

Details

static create(Exception $exception, $statusCode = null, array $headers = array())

Parameters

Exception $exception
$statusCode
array $headers

static FlattenException createFromThrowable(Throwable $exception, int|null $statusCode = null, array $headers = array())

Parameters

Throwable $exception
int|null $statusCode
array $headers

Return Value

FlattenException

toArray()

getStatusCode()

setStatusCode($code)

Parameters

$code

getHeaders()

setHeaders(array $headers)

Parameters

array $headers

getClass()

setClass($class)

Parameters

$class

getFile()

setFile($file)

Parameters

$file

getLine()

setLine($line)

Parameters

$line

getMessage()

setMessage($message)

Parameters

$message

getCode()

setCode($code)

Parameters

$code

getPrevious()

setPrevious(FlattenException $previous)

Parameters

FlattenException $previous

getAllPrevious()

getTrace()

setTraceFromException(Exception $exception) deprecated

deprecated

since 4.1, use {@see setTraceFromThrowable()} instead.

Parameters

Exception $exception

void setTraceFromThrowable(Throwable $throwable)

Parameters

Throwable $throwable

Return Value

void

setTrace($trace, $file, $line)

Parameters

$trace
$file
$line

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Debug/Exception/FlattenException.html