PHP Class Pop\Code\Generator\DocblockGenerator

Author: Nick Sagona, III ([email protected])
Inheritance: implements Pop\Code\Generator\GeneratorInterface
Afficher le fichier Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Свойство Type Description
$desc string Docblock description
$indent string Docblock indent
$output string Docblock output
$tags array Docblock tags

Méthodes publiques

Méthode Description
__construct ( string $desc = null, string $indent = null ) : DocblockGenerator Constructor
__toString ( ) : string Print docblock
factory ( string $desc = null, string $indent = null ) : DocblockGenerator Static method to instantiate the docblock object and return itself to facilitate chaining methods together.
getDesc ( ) : string Get the docblock description
getIndent ( ) : string Get the docblock indent
getParam ( integer $index ) : array Get a param
getReturn ( ) : array Get the return
getTag ( string $name ) : string Get a tag
parse ( string $docblock, string $forceIndent = null ) : DocblockGenerator Static method to parse a docblock string and return a new docblock generator object.
render ( boolean $ret = false ) : mixed Render docblock
setDesc ( string $desc = null ) : DocblockGenerator Set the docblock description
setIndent ( string $indent = null ) : DocblockGenerator Set the docblock indent
setParam ( string $type, string $var = null, string $desc = null ) : DocblockGenerator Add a param tag
setParams ( array $params ) : DocblockGenerator Add a param tag
setReturn ( string $type, string $desc = null ) : DocblockGenerator Add a return tag
setTag ( string $name, string $desc = null ) : DocblockGenerator Add a basic tag
setTags ( array $tags ) : DocblockGenerator Add basic tags

Méthodes protégées

Méthode Description
formatTags ( ) : string Format the docblock tags
getParamLength ( ) : integer Get the longest param type length
getTagLength ( ) : integer Get the longest tag length

Method Details

__construct() public méthode

Instantiate the docblock generator object
public __construct ( string $desc = null, string $indent = null ) : DocblockGenerator
$desc string
$indent string
Résultat DocblockGenerator

__toString() public méthode

Print docblock
public __toString ( ) : string
Résultat string

factory() public static méthode

Static method to instantiate the docblock object and return itself to facilitate chaining methods together.
public static factory ( string $desc = null, string $indent = null ) : DocblockGenerator
$desc string
$indent string
Résultat DocblockGenerator

formatTags() protected méthode

Format the docblock tags
protected formatTags ( ) : string
Résultat string

getDesc() public méthode

Get the docblock description
public getDesc ( ) : string
Résultat string

getIndent() public méthode

Get the docblock indent
public getIndent ( ) : string
Résultat string

getParam() public méthode

Get a param
public getParam ( integer $index ) : array
$index integer
Résultat array

getParamLength() protected méthode

Get the longest param type length
protected getParamLength ( ) : integer
Résultat integer

getReturn() public méthode

Get the return
public getReturn ( ) : array
Résultat array

getTag() public méthode

Get a tag
public getTag ( string $name ) : string
$name string
Résultat string

getTagLength() protected méthode

Get the longest tag length
protected getTagLength ( ) : integer
Résultat integer

parse() public static méthode

Static method to parse a docblock string and return a new docblock generator object.
public static parse ( string $docblock, string $forceIndent = null ) : DocblockGenerator
$docblock string
$forceIndent string
Résultat DocblockGenerator

render() public méthode

Render docblock
public render ( boolean $ret = false ) : mixed
$ret boolean
Résultat mixed

setDesc() public méthode

Set the docblock description
public setDesc ( string $desc = null ) : DocblockGenerator
$desc string
Résultat DocblockGenerator

setIndent() public méthode

Set the docblock indent
public setIndent ( string $indent = null ) : DocblockGenerator
$indent string
Résultat DocblockGenerator

setParam() public méthode

Add a param tag
public setParam ( string $type, string $var = null, string $desc = null ) : DocblockGenerator
$type string
$var string
$desc string
Résultat DocblockGenerator

setParams() public méthode

Add a param tag
public setParams ( array $params ) : DocblockGenerator
$params array
Résultat DocblockGenerator

setReturn() public méthode

Add a return tag
public setReturn ( string $type, string $desc = null ) : DocblockGenerator
$type string
$desc string
Résultat DocblockGenerator

setTag() public méthode

Add a basic tag
public setTag ( string $name, string $desc = null ) : DocblockGenerator
$name string
$desc string
Résultat DocblockGenerator

setTags() public méthode

Add basic tags
public setTags ( array $tags ) : DocblockGenerator
$tags array
Résultat DocblockGenerator

Property Details

$desc protected_oe property

Docblock description
protected string $desc
Résultat string

$indent protected_oe property

Docblock indent
protected string $indent
Résultat string

$output protected_oe property

Docblock output
protected string $output
Résultat string

$tags protected_oe property

Docblock tags
protected array $tags
Résultat array