\Pop\Code\GeneratorNamespaceGenerator

Namespace generator class

Summary

Methods
Properties
Constants
setName()
getName()
hasName()
setDocblock()
getDocblock()
hasDocblock()
setDesc()
getDesc()
hasDesc()
addUse()
addUses()
hasUse()
hasUses()
getUses()
setIndent()
getIndent()
hasIndent()
printIndent()
getOutput()
hasOutput()
isRendered()
render()
__construct()
__toString()
No public properties found
No constants found
No protected methods found
$name
$docblock
$uses
$indent
$output
N/A
No private methods found
No private properties found
N/A

Properties

$name

$name : string

Name

Type

string

$uses

$uses : array

Array of namespaces to use

Type

array

$indent

$indent : integer

Code indent spaces

Type

integer

$output

$output : string

Output string

Type

string

Methods

getName()

getName() : string

Get the name

Returns

string

hasName()

hasName() : boolean

Get the name

Returns

boolean

hasDocblock()

hasDocblock() : boolean

Has docblock generator object

Returns

boolean

getDesc()

getDesc() : string

Get the docblock description

Returns

string

hasDesc()

hasDesc() : boolean

Has a docblock description

Returns

boolean

addUse()

addUse(string  $use, string  $as = null) : \Pop\Code\Generator\Traits\UseTrait

Add a namespace to use

Parameters

string $use
string $as

Returns

\Pop\Code\Generator\Traits\UseTrait

hasUse()

hasUse(string  $use) : boolean

Has use

Parameters

string $use

Returns

boolean

hasUses()

hasUses() : boolean

Has uses

Returns

boolean

getUses()

getUses() : array

Get uses

Returns

array

getIndent()

getIndent() : integer

Get the indent

Returns

integer

hasIndent()

hasIndent() : boolean

Has indent

Returns

boolean

printIndent()

printIndent() : string

Print the indent

Returns

string

getOutput()

getOutput() : string

Get the output

Returns

string

hasOutput()

hasOutput() : boolean

Has output

Returns

boolean

isRendered()

isRendered() : boolean

Is rendered (alias to hasOutput())

Returns

boolean

render()

render() : string

Render namespace

Returns

string

__construct()

__construct(string  $namespace = null, integer  $indent) 

Constructor

Instantiate the namespace generator object

Parameters

string $namespace
integer $indent

__toString()

__toString() : string

Print namespace

Returns

string