Documentation

DocblockGenerator extends AbstractGenerator
in package

Abstract generator class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

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

license

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

version
4.1.0

Table of Contents

$desc  : string
Docblock description
$indent  : int
Code indent spaces
$output  : string
Output string
$tags  : array<string|int, mixed>
Docblock tags
__construct()  : mixed
Constructor
__toString()  : string
Print docblock
addParam()  : DocblockGenerator
Add a param tag
addParams()  : DocblockGenerator
Add a param tag
addTag()  : DocblockGenerator
Add a basic tag
addTags()  : DocblockGenerator
Add basic tags
getDesc()  : string
Get the docblock description
getIndent()  : int
Get the indent
getOutput()  : string
Get the output
getParam()  : array<string|int, mixed>
Get a param
getReturn()  : array<string|int, mixed>
Get the return
getTag()  : string
Get a tag
getThrows()  : array<string|int, mixed>
Get the throws
hasDesc()  : bool
Has a docblock description
hasIndent()  : bool
Has indent
hasOutput()  : bool
Has output
hasParam()  : bool
Has a param
hasReturn()  : bool
Has a return
hasTag()  : bool
Has a tag
hasThrows()  : bool
Has a throws
isRendered()  : bool
Is rendered (alias to hasOutput())
printIndent()  : string
Print the indent
render()  : string
Render docblock
setDesc()  : DocblockGenerator
Set the docblock description
setIndent()  : AbstractGenerator
Set the indent
setReturn()  : DocblockGenerator
Add a return tag
setThrows()  : DocblockGenerator
Add a throws tag
formatTags()  : string
Format the docblock tags
getParamLength()  : int
Get the longest param type length
getTagLength()  : int
Get the longest tag length

Properties

$tags

Docblock tags

protected array<string|int, mixed> $tags = ['param' => []]

Methods

__construct()

Constructor

public __construct([string $desc = null ][, int $indent = 4 ]) : mixed

Instantiate the docblock generator object

Parameters
$desc : string = null
$indent : int = 4
Return values
mixed

__toString()

Print docblock

public __toString() : string
Return values
string

addParam()

Add a param tag

public addParam([string $type = null ][, string $var = null ][, string $desc = null ]) : DocblockGenerator
Parameters
$type : string = null
$var : string = null
$desc : string = null
Return values
DocblockGenerator

getDesc()

Get the docblock description

public getDesc() : string
Return values
string

getOutput()

Get the output

public getOutput() : string
Return values
string

getParam()

Get a param

public getParam(int $index) : array<string|int, mixed>
Parameters
$index : int
Return values
array<string|int, mixed>

getReturn()

Get the return

public getReturn() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTag()

Get a tag

public getTag(string $name) : string
Parameters
$name : string
Return values
string

getThrows()

Get the throws

public getThrows() : array<string|int, mixed>
Return values
array<string|int, mixed>

hasDesc()

Has a docblock description

public hasDesc() : bool
Return values
bool

hasParam()

Has a param

public hasParam(int $index) : bool
Parameters
$index : int
Return values
bool

hasTag()

Has a tag

public hasTag(string $name) : bool
Parameters
$name : string
Return values
bool

isRendered()

Is rendered (alias to hasOutput())

public isRendered() : bool
Return values
bool

printIndent()

Print the indent

public printIndent() : string
Return values
string

formatTags()

Format the docblock tags

protected formatTags() : string
Return values
string

getParamLength()

Get the longest param type length

protected getParamLength() : int
Return values
int

getTagLength()

Get the longest tag length

protected getTagLength() : int
Return values
int

Search results