Methods

Passes $options to {@link setOptions()}.

__construct(array | \Traversable $options) 

Parameters

$options

array\Traversable

fromArray()

fromArray(array $values) : \Zend\Code\Generator\FileGenerator

Parameters

$values

array

Returns

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\Reflection\Exception\InvalidArgumentException If file does not exists
\Zend\Code\Reflection\Exception\RuntimeException If file exists but is not included or required

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

getFilename()

getFilename() : string

Returns

string

getIndentation()

getIndentation() : string
Inherited

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

Returns

string

getNamespace()

getNamespace() : string

Returns

string

getRequiredFiles()

getRequiredFiles() : array

Returns

array

getSourceContent()

getSourceContent() : string
Inherited

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

Returns

string

Returns an array with the first element the use statement, second is the as part.

getUses(bool $withResolvedAs) : array

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 $indentation) : \Zend\Code\Generator\AbstractGenerator
Inherited

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

Parameters

$indentation

string

Returns

setNamespace()

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

Parameters

$namespace

string

Returns

setOptions()

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

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

Parameters

$options

array\Traversable

Exceptions

\Zend\Code\Generator\Exception\InvalidArgumentException

Returns

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, null | string $as) : \Zend\Code\Generator\FileGenerator

Parameters

$use

string

$as

nullstring

Returns

setUses()

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

Parameters

$uses

array

Returns

 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