\Pop\Code\GeneratorDocblockGenerator

Docblock generator code class

Summary

Methods
Properties
Constants
__construct()
parse()
setDesc()
getDesc()
setIndent()
getIndent()
setTag()
setTags()
getTag()
setParam()
setParams()
getParam()
setReturn()
getReturn()
render()
__toString()
No public properties found
No constants found
formatTags()
getTagLength()
getParamLength()
$desc
$tags
$indent
$output
N/A
No private methods found
No private properties found
N/A

Properties

$desc

$desc : string

Docblock description

Type

string

$tags

$tags : array

Docblock tags

Type

array

$indent

$indent : string

Docblock indent

Type

string

$output

$output : string

Docblock output

Type

string

Methods

__construct()

__construct(string  $desc = null, string  $indent = null) 

Constructor

Instantiate the docblock generator object

Parameters

string $desc
string $indent

parse()

parse(string  $docblock, string  $forceIndent = null) : \Pop\Code\Generator\DocblockGenerator

Static method to parse a docblock string and return a new docblock generator object.

Parameters

string $docblock
string $forceIndent

Throws

\Pop\Code\Generator\Exception

Returns

\Pop\Code\Generator\DocblockGenerator

getDesc()

getDesc() : string

Get the docblock description

Returns

string

getIndent()

getIndent() : string

Get the docblock indent

Returns

string

setTag()

setTag(string  $name, string  $desc = null) : \Pop\Code\Generator\DocblockGenerator

Add a basic tag

Parameters

string $name
string $desc

Returns

\Pop\Code\Generator\DocblockGenerator

getTag()

getTag(string  $name) : string

Get a tag

Parameters

string $name

Returns

string

setParam()

setParam(string  $type, string  $var = null, string  $desc = null) : \Pop\Code\Generator\DocblockGenerator

Add a param tag

Parameters

string $type
string $var
string $desc

Returns

\Pop\Code\Generator\DocblockGenerator

getParam()

getParam(integer  $index) : array

Get a param

Parameters

integer $index

Returns

array

setReturn()

setReturn(string  $type, string  $desc = null) : \Pop\Code\Generator\DocblockGenerator

Add a return tag

Parameters

string $type
string $desc

Returns

\Pop\Code\Generator\DocblockGenerator

getReturn()

getReturn() : array

Get the return

Returns

array

render()

render(boolean  $ret = false) : mixed

Render docblock

Parameters

boolean $ret

Returns

mixed

__toString()

__toString() : string

Print docblock

Returns

string

formatTags()

formatTags() : string

Format the docblock tags

Returns

string

getTagLength()

getTagLength() : integer

Get the longest tag length

Returns

integer

getParamLength()

getParamLength() : integer

Get the longest param type length

Returns

integer