BodyGenerator
extends AbstractGenerator
in package
Uses
DocblockTrait, BodyTrait
Body generator class
Tags
Table of Contents
- $body : string
- Function body
- $docblock : DocblockGenerator
- Docblock generator object
- $indent : int
- Code indent spaces
- $output : string
- Output string
- __toString() : string
- Print function
- appendToBody() : BodyTrait
- Append to the function body
- createReturnConfig() : BodyGenerator
- Create return config
- getBody() : string
- Get the function body
- getDesc() : string
- Get the docblock description
- getDocblock() : DocblockGenerator
- Access the docblock generator object
- getIndent() : int
- Get the indent
- getOutput() : string
- Get the output
- hasBody() : bool
- Has method body
- hasDesc() : bool
- Has a docblock description
- hasDocblock() : bool
- Has docblock generator object
- hasIndent() : bool
- Has indent
- hasOutput() : bool
- Has output
- indentBody() : BodyTrait
- Append to the function body
- isRendered() : bool
- Is rendered (alias to hasOutput())
- printIndent() : string
- Print the indent
- render() : string
- Render body
- setBody() : BodyTrait
- Set the function body
- setDesc() : DocblockTrait
- Set the docblock description
- setDocblock() : DocblockTrait
- Set the docblock generator object
- setIndent() : AbstractGenerator
- Set the indent
Properties
$body
Function body
protected
string
$body
= null
$docblock
Docblock generator object
protected
DocblockGenerator
$docblock
= null
$indent
Code indent spaces
protected
int
$indent
= 4
$output
Output string
protected
string
$output
= null
Methods
__toString()
Print function
public
__toString() : string
Return values
string —appendToBody()
Append to the function body
public
appendToBody(string $body) : BodyTrait
Parameters
- $body : string
Return values
BodyTrait —createReturnConfig()
Create return config
public
createReturnConfig(array<string|int, mixed> $config[, int $indent = 4 ]) : BodyGenerator
Parameters
- $config : array<string|int, mixed>
- $indent : int = 4
Return values
BodyGenerator —getBody()
Get the function body
public
getBody() : string
Return values
string —getDesc()
Get the docblock description
public
getDesc() : string
Return values
string —getDocblock()
Access the docblock generator object
public
getDocblock() : DocblockGenerator
Return values
DocblockGenerator —getIndent()
Get the indent
public
getIndent() : int
Return values
int —getOutput()
Get the output
public
getOutput() : string
Return values
string —hasBody()
Has method body
public
hasBody() : bool
Return values
bool —hasDesc()
Has a docblock description
public
hasDesc() : bool
Return values
bool —hasDocblock()
Has docblock generator object
public
hasDocblock() : bool
Return values
bool —hasIndent()
Has indent
public
hasIndent() : bool
Return values
bool —hasOutput()
Has output
public
hasOutput() : bool
Return values
bool —indentBody()
Append to the function body
public
indentBody(int $indent) : BodyTrait
Parameters
- $indent : int
Return values
BodyTrait —isRendered()
Is rendered (alias to hasOutput())
public
isRendered() : bool
Return values
bool —printIndent()
Print the indent
public
printIndent() : string
Return values
string —render()
Render body
public
render() : string
Return values
string —setBody()
Set the function body
public
setBody(string $body[, int $indent = 4 ]) : BodyTrait
Parameters
- $body : string
- $indent : int = 4
Return values
BodyTrait —setDesc()
Set the docblock description
public
setDesc([string $desc = null ]) : DocblockTrait
Parameters
- $desc : string = null
Return values
DocblockTrait —setDocblock()
Set the docblock generator object
public
setDocblock(DocblockGenerator $docblock) : DocblockTrait
Parameters
- $docblock : DocblockGenerator
Return values
DocblockTrait —setIndent()
Set the indent
public
setIndent(string $indent) : AbstractGenerator
Parameters
- $indent : string