category Zend
package Zend_Code_Generator

 Methods

Constructor

__construct(array | \Traversable $options) 

Passes $options to setOptions().

Parameters

$options

array\Traversable

fromArray()

fromArray(array $values) 

Parameters

$values

fromReflectedFilePath() - use this if you intend on generating code generation objects based on the same file.

fromReflectedFileName(string $filePath, bool $includeIfNotAlreadyIncluded) : \Zend\Code\Generator\FileGenerator

This will keep previous changes to the file in tact during the same PHP process

Parameters

$filePath

string

$includeIfNotAlreadyIncluded

bool

Exceptions

\Zend\Code\Generator\Exception\InvalidArgumentException

Returns

fromReflection()

fromReflection(\Zend\Code\Reflection\FileReflection $fileReflection) : \Zend\Code\Generator\FileGenerator

generate()

generate() : string

Returns

string

getBody()

getBody() : string

Returns

string

getClass()

getClass(string $name) : \Zend\Code\Generator\ClassGenerator

Parameters

$name

string

Returns

getClasses()

getClasses() : \Zend\Code\Generator\ClassGenerator[]

Returns

\Zend\Code\Generator\ClassGenerator[]Array of ClassGenerators

getFilename()

getFilename() : string

Returns

string

getIndentation()

getIndentation() : string | int
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::getIndentation()

Returns

stringint

getNamespace()

getNamespace() : string

Returns

string

getRequiredFiles()

getRequiredFiles() : array

Returns

array

getSourceContent()

getSourceContent() : string
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::getSourceContent()

Returns

string

getUses()

getUses(bool $withResolvedAs) : array

Returns an array with the first element the use statement, second is the as part. If $withResolvedAs is set to true, there will be a third element that is the "resolved" as statement, as the second part is not required in use statements

Parameters

$withResolvedAs

bool

Returns

array

isSourceDirty()

isSourceDirty() : bool

Returns

bool

setBody()

setBody(string $body) : \Zend\Code\Generator\FileGenerator

Parameters

$body

string

Returns

setClasses()

setClasses(array $classes) : \Zend\Code\Generator\FileGenerator

Parameters

$classes

array

Returns

setFilename()

setFilename(string $filename) : \Zend\Code\Generator\FileGenerator

Parameters

$filename

string

Returns

setIndentation()

setIndentation(string | int $indentation) : \Zend\Code\Generator\AbstractGenerator
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::setIndentation()

Parameters

$indentation

stringint

Returns

setNamespace()

setNamespace($namespace) : \Zend\Code\Generator\FileGenerator

Parameters

$namespace

Returns

setOptions()

setOptions(array | \Traversable $options) : \Zend\Code\Generator\self
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::setOptions()

Parameters

$options

array\Traversable

Exceptions

\Zend\Code\Generator\Exception\InvalidArgumentException

Returns

\Zend\Code\Generator\self

setRequiredFiles

setRequiredFiles(array $requiredFiles) : \Zend\Code\Generator\FileGenerator

Parameters

$requiredFiles

array

Returns

setSourceContent()

setSourceContent(string $sourceContent) : \Zend\Code\Generator\AbstractGenerator
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::setSourceContent()

Parameters

$sourceContent

string

Returns

setSourceDirty()

setSourceDirty(bool $isSourceDirty) : \Zend\Code\Generator\AbstractGenerator
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::setSourceDirty()

Parameters

$isSourceDirty

bool

Returns

setUse()

setUse(string $use, string $as) : \Zend\Code\Generator\FileGenerator

Parameters

$use

string

$as

string

Returns

setUses()

setUses(array $uses) : \Zend\Code\Generator\FileGenerator

Parameters

$uses

array

Returns

write()

write() 

 Properties

 

$body

$body : string

 

$classes

$classes : array

 

$docBlock

$docBlock : \Zend\Code\Generator\DocBlockGenerator

 

$filename

$filename : string

 

<p>4 spaces by default</p>

$indentation : int | string
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::$$indentation
 

$isSourceDirty

$isSourceDirty : bool
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::$$isSourceDirty
 

$namespace

$namespace : string

 

$requiredFiles

$requiredFiles : array

 

$sourceContent

$sourceContent : string
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::$$sourceContent
 

$uses

$uses : array

 Constants

 

Line feed to use in place of EOL

LINE_FEED 
Inherited

inherited_from \Zend\Code\Generator\AbstractGenerator::LINE_FEED