Documentation

DocblockGenerator extends AbstractGenerator
in package

Abstract 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

$desc  : string|null
Docblock description
$indent  : int
Code indent spaces
$output  : string|null
Output string
$tags  : array<string|int, mixed>
Docblock tags

Methods

__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|null
Get the docblock description
getIndent()  : int
Get the indent
getOutput()  : string
Get the output
getParam()  : array<string|int, mixed>|null
Get a param
getReturn()  : array<string|int, mixed>|null
Get the return
getTag()  : string|null
Get a tag
getThrows()  : array<string|int, mixed>|null
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|null $desc = null ][, int $indent = 4 ]) : mixed

Instantiate the docblock generator object

Parameters
$desc : string|null = null
$indent : int = 4

__toString()

Print docblock

public __toString() : string
Return values
string

addParam()

Add a param tag

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

getDesc()

Get the docblock description

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

getParam()

Get a param

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

getReturn()

Get the return

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

getTag()

Get a tag

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

getThrows()

Get the throws

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

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

        
On this page

Search results