Documentation

BodyGenerator extends AbstractGenerator
in package
Uses DocblockTrait, BodyTrait

Body generator class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
5.0.0

Table of Contents

Properties

$body  : string|null
Function body
$docblock  : DocblockGenerator|null
Docblock generator object
$indent  : int
Code indent spaces
$output  : string|null
Output string

Methods

__toString()  : string
Print function
appendToBody()  : static
Append to the function body
createReturnConfig()  : BodyGenerator
Create return config
getBody()  : string|null
Get the function body
getDesc()  : string|null
Get the docblock description
getDocblock()  : DocblockGenerator|null
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()  : static
Append to the function body
isRendered()  : bool
Is rendered (alias to hasOutput())
printIndent()  : string
Print the indent
render()  : string
Render body
setBody()  : static
Set the function body
setDesc()  : static
Set the docblock description
setDocblock()  : static
Set the docblock generator object
setIndent()  : AbstractGenerator
Set the indent

Properties

$body

Function body

protected string|null $body = null

Methods

__toString()

Print function

public __toString() : string
Return values
string

appendToBody()

Append to the function body

public appendToBody(string $body) : static
Parameters
$body : string
Return values
static

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|null
Return values
string|null

getDesc()

Get the docblock description

public getDesc() : string|null
Return values
string|null

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

indentBody()

Append to the function body

public indentBody(int $indent) : static
Parameters
$indent : int
Return values
static

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 ]) : static
Parameters
$body : string
$indent : int = 4
Return values
static

setDesc()

Set the docblock description

public setDesc([string|null $desc = null ]) : static
Parameters
$desc : string|null = null
Return values
static

        
On this page

Search results