Reflection Docblock

InvalidTag
in package
implements Tag

FinalYes

This class represents an exception during the tag creation

Since the internals of the library are relaying on the correct syntax of a docblock we cannot simply throw exceptions at all time because the exceptions will break the creation of a docklock. Just silently ignore the exceptions is not an option because the user as an issue to fix.

This tag holds that error information until a using application is able to display it. The object will just behave like any normal tag. So the normal application flow will not break.

Table of Contents

Interfaces

Tag

Properties

$body  : string
$name  : string
$throwable  : Throwable|null

Methods

__toString()  : string
create()  : Tag|mixed
getException()  : Throwable|null
getName()  : string
render()  : string
withError()  : self
__construct()  : mixed
flattenArguments()  : mixed
flattenExceptionBacktrace()  : void
Removes all complex types from backtrace

Properties

$throwable

private Throwable|null $throwable = null

Methods

__toString()

public __toString() : string
Return values
string

create()

public static create(string $body[, string $name = '' ]) : Tag|mixed
Parameters
$body : string
$name : string = ''
Return values
Tag|mixed

Class that implements Tag

getException()

public getException() : Throwable|null
Return values
Throwable|null

getName()

public getName() : string
Return values
string

withError()

public withError(Throwable $exception) : self
Parameters
$exception : Throwable
Return values
self

__construct()

private __construct(string $name, string $body) : mixed
Parameters
$name : string
$body : string

flattenArguments()

private flattenArguments(mixed $value) : mixed
Parameters
$value : mixed
Tags
throws
ReflectionException

flattenExceptionBacktrace()

Removes all complex types from backtrace

private flattenExceptionBacktrace(Throwable $exception) : void

Not all objects are serializable. So we need to remove them from the stored exception to be sure that we do not break existing library usage.

Parameters
$exception : Throwable

        
On this page

Search results