Properties

$indent

$indent : integer

Code indent spaces

Type

integer

$output

$output : string

Output string

Type

string

$code

$code : array

Code generator objects

Type

array

$namespaces

$namespaces : array

Namespaces for the code generator objects

Type

array

$env

$env : string

Environment setting, i.e. #!/usr/bin/php

Type

string

$close

$close : boolean

Flag to close the code file with ?>

Type

boolean

$filename

$filename : string

Code filename

Type

string

Methods

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

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 method

Returns

string

__construct()

__construct(mixed  $code = null) 

Constructor

Instantiate the code generator object

Parameters

mixed $code

Throws

\Pop\Code\Exception

addCodeObjects()

addCodeObjects(array  $codeObjects) : \Pop\Code\Generator

Add code generator objects

Parameters

array $codeObjects

Returns

\Pop\Code\Generator

hasCode()

hasCode() : boolean

Has code generator objects

Returns

boolean

getCode()

getCode() : array

Access the code generator object

Returns

array

code()

code() : array

Access the code generator objects (alias method)

Returns

array

setCloseTag()

setCloseTag(boolean  $close = false) : \Pop\Code\Generator

Set the code close tag flag

Parameters

boolean $close

Returns

\Pop\Code\Generator

hasCloseTag()

hasCloseTag() : boolean

Determine if the code close tag flag is set

Returns

boolean

setEnv()

setEnv(string  $env = null) : \Pop\Code\Generator

Set the environment

Parameters

string $env

Returns

\Pop\Code\Generator

getEnv()

getEnv() : string

Get the environment

Returns

string

hasEnv()

hasEnv() : boolean

Determine if the environment is set

Returns

boolean

setFilename()

setFilename(string  $filename) : \Pop\Code\Generator

Set the filename

Parameters

string $filename

Returns

\Pop\Code\Generator

hasFilename()

hasFilename() : boolean

Has filename

Returns

boolean

getFilename()

getFilename() : string

Get filename

Returns

string

writeToFile()

writeToFile(string  $filename = null) : void

Write to file

Parameters

string $filename

Throws

\Pop\Code\Exception

outputToHttp()

outputToHttp(string  $filename = null, boolean  $forceDownload = false, array  $headers = array()) : void

Output to HTTP

Parameters

string $filename
boolean $forceDownload
array $headers

__toString()

__toString() : string

Print code

Returns

string