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
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
$body
private
string
$body
$name
private
string
$name
$throwable
private
Throwable|null
$throwable
= null
Methods
__toString()
public
__toString() : string
Return values
stringcreate()
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|nullgetName()
public
getName() : string
Return values
stringrender()
public
render([Formatter|null $formatter = null ]) : string
Parameters
- $formatter : Formatter|null = null
Return values
stringwithError()
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
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