Generator
        
        extends AbstractGenerator
    
    
            
            in package
            
        
    
    
            
            Uses
                            DocblockTrait                    
    
        
            Generator code class
Tags
Table of Contents
- $close : bool
- Flag to close the code file with ?>
- $code : array<string|int, mixed>
- Code generator objects
- $docblock : DocblockGenerator
- Docblock generator object
- $env : string
- Environment setting, i.e. #!/usr/bin/php
- $filename : string
- Code filename
- $indent : int
- Code indent spaces
- $namespaces : array<string|int, mixed>
- Namespaces for the code generator objects
- $output : string
- Output string
- __construct() : mixed
- Constructor
- __toString() : string
- Print code
- addCodeObject() : Generator
- Add a code generator object
- addCodeObjects() : Generator
- Add code generator objects
- code() : array<string|int, mixed>
- Access the code generator objects (alias method)
- getCode() : array<string|int, mixed>
- Access the code generator object
- getDesc() : string
- Get the docblock description
- getDocblock() : DocblockGenerator
- Access the docblock generator object
- getEnv() : string
- Get the environment
- getFilename() : string
- Get filename
- getIndent() : int
- Get the indent
- getOutput() : string
- Get the output
- hasCloseTag() : bool
- Determine if the code close tag flag is set
- hasCode() : bool
- Has code generator objects
- hasDesc() : bool
- Has a docblock description
- hasDocblock() : bool
- Has docblock generator object
- hasEnv() : bool
- Determine if the environment is set
- hasFilename() : bool
- Has filename
- hasIndent() : bool
- Has indent
- hasOutput() : bool
- Has output
- isRendered() : bool
- Is rendered (alias to hasOutput())
- outputToHttp() : void
- Output to HTTP
- printIndent() : string
- Print the indent
- render() : string
- Render method
- setCloseTag() : Generator
- Set the code close tag flag
- setDesc() : DocblockTrait
- Set the docblock description
- setDocblock() : DocblockTrait
- Set the docblock generator object
- setEnv() : Generator
- Set the environment
- setFilename() : Generator
- Set the filename
- setIndent() : AbstractGenerator
- Set the indent
- writeToFile() : void
- Write to file
Properties
$close
Flag to close the code file with ?>
    protected
        bool
    $close
     = false
        
    
$code
Code generator objects
    protected
        array<string|int, mixed>
    $code
     = []
        
    
$docblock
Docblock generator object
    protected
        DocblockGenerator
    $docblock
     = null
        
    
$env
Environment setting, i.e. #!/usr/bin/php
    protected
        string
    $env
     = null
        
    
$filename
Code filename
    protected
        string
    $filename
     = null
        
    
$indent
Code indent spaces
    protected
        int
    $indent
     = 4
        
    
$namespaces
Namespaces for the code generator objects
    protected
        array<string|int, mixed>
    $namespaces
     = []
        
    
$output
Output string
    protected
        string
    $output
     = null
        
    
Methods
__construct()
Constructor
    public
                __construct([mixed $code = null ]) : mixed
        Instantiate the code generator object
Parameters
- $code : mixed = null
Tags
Return values
mixed —__toString()
Print code
    public
                __toString() : string
        
    
    
        Return values
string —addCodeObject()
Add a code generator object
    public
                addCodeObject(GeneratorInterface $codeObject[, string $namespace = null ]) : Generator
        
        Parameters
- $codeObject : GeneratorInterface
- $namespace : string = null
Return values
Generator —addCodeObjects()
Add code generator objects
    public
                addCodeObjects(array<string|int, mixed> $codeObjects) : Generator
        
        Parameters
- $codeObjects : array<string|int, mixed>
Return values
Generator —code()
Access the code generator objects (alias method)
    public
                code() : array<string|int, mixed>
        
    
    
        Return values
array<string|int, mixed> —getCode()
Access the code generator object
    public
                getCode() : array<string|int, mixed>
        
    
    
        Return values
array<string|int, mixed> —getDesc()
Get the docblock description
    public
                getDesc() : string
        
    
    
        Return values
string —getDocblock()
Access the docblock generator object
    public
                getDocblock() : DocblockGenerator
        
    
    
        Return values
DocblockGenerator —getEnv()
Get the environment
    public
                getEnv() : string
        
    
    
        Return values
string —getFilename()
Get filename
    public
                getFilename() : string
        
    
    
        Return values
string —getIndent()
Get the indent
    public
                getIndent() : int
        
    
    
        Return values
int —getOutput()
Get the output
    public
                getOutput() : string
        
    
    
        Return values
string —hasCloseTag()
Determine if the code close tag flag is set
    public
                hasCloseTag() : bool
        
    
    
        Return values
bool —hasCode()
Has code generator objects
    public
                hasCode() : bool
        
    
    
        Return values
bool —hasDesc()
Has a docblock description
    public
                hasDesc() : bool
        
    
    
        Return values
bool —hasDocblock()
Has docblock generator object
    public
                hasDocblock() : bool
        
    
    
        Return values
bool —hasEnv()
Determine if the environment is set
    public
                hasEnv() : bool
        
    
    
        Return values
bool —hasFilename()
Has filename
    public
                hasFilename() : bool
        
    
    
        Return values
bool —hasIndent()
Has indent
    public
                hasIndent() : bool
        
    
    
        Return values
bool —hasOutput()
Has output
    public
                hasOutput() : bool
        
    
    
        Return values
bool —isRendered()
Is rendered (alias to hasOutput())
    public
                isRendered() : bool
        
    
    
        Return values
bool —outputToHttp()
Output to HTTP
    public
                outputToHttp([string $filename = null ][, bool $forceDownload = false ][, array<string|int, mixed> $headers = [] ]) : void
        
        Parameters
- $filename : string = null
- $forceDownload : bool = false
- $headers : array<string|int, mixed> = []
Return values
void —printIndent()
Print the indent
    public
                printIndent() : string
        
    
    
        Return values
string —render()
Render method
    public
                render() : string
        
    
    
        Return values
string —setCloseTag()
Set the code close tag flag
    public
                setCloseTag([bool $close = false ]) : Generator
        
        Parameters
- $close : bool = false
Return values
Generator —setDesc()
Set the docblock description
    public
                setDesc([string $desc = null ]) : DocblockTrait
        
        Parameters
- $desc : string = null
Return values
DocblockTrait —setDocblock()
Set the docblock generator object
    public
                setDocblock(DocblockGenerator $docblock) : DocblockTrait
        
        Parameters
- $docblock : DocblockGenerator
Return values
DocblockTrait —setEnv()
Set the environment
    public
                setEnv([string $env = null ]) : Generator
        
        Parameters
- $env : string = null
Return values
Generator —setFilename()
Set the filename
    public
                setFilename(string $filename) : Generator
        
        Parameters
- $filename : string
Return values
Generator —setIndent()
Set the indent
    public
                setIndent(string $indent) : AbstractGenerator
        
        Parameters
- $indent : string
Return values
AbstractGenerator —writeToFile()
Write to file
    public
                writeToFile([string $filename = null ]) : void
        
        Parameters
- $filename : string = null