package Default
inherited_from \Zend\Code\Generator\AbstractGenerator

 Methods

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

__construct(array|\Traversable $options = null
inherited_from \Zend\Code\Generator\AbstractGenerator::__construct()

Parameters

$options

array\Traversable

__construct()

__construct(array $options = array()
Inherited

Parameters

$options

array

fromArray()

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

Parameters

$values

array

Returns

\Zend\Code\Generator\FileGenerator

Use this if you intend on generating code generation objects based on the same file.

fromReflectedFileName(string $filePath, boolean $includeIfNotAlreadyIncluded = true) : \Zend\Code\Generator\FileGenerator
Static

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

Parameters

$filePath

string

$includeIfNotAlreadyIncluded

boolean

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

\Zend\Code\Generator\FileGenerator

fromReflection()

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

Parameters

$fileReflection

\Zend\Code\Reflection\FileReflection

Returns

\Zend\Code\Generator\FileGenerator

generate()

generate() : string

Returns

string

getBody()

getBody() : string

Returns

string

getClass()

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

Parameters

$name

string

Returns

\Zend\Code\Generator\ClassGenerator

getClasses()

getClasses() : array<mixed,\Zend\Code\Generator\ClassGenerator>

Returns

array<mixed,\Zend\Code\Generator\ClassGenerator>

getDocBlock()

getDocBlock() : \Zend\Code\Generator\DocBlockGenerator

Returns

\Zend\Code\Generator\DocBlockGenerator

getFilename()

getFilename() : string

Returns

string

getIndentation()

getIndentation() : string
Inherited

Returns

string

getNamespace()

getNamespace() : string

Returns

string

getRequiredFiles()

getRequiredFiles() : array

Returns

array

getSourceContent()

getSourceContent() : string
Inherited

Returns

string

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

getUses(boolean $withResolvedAs = false) : 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

boolean

Returns

array

isSourceDirty()

isSourceDirty() : boolean
inherited_from \Zend\Code\Generator\AbstractGenerator::isSourceDirty()

Returns

boolean

isSourceDirty()

isSourceDirty() : boolean
Inherited

Returns

boolean

setBody()

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

Parameters

$body

string

Returns

\Zend\Code\Generator\FileGenerator

setClass()

setClass(array|string|\Zend\Code\Generator\ClassGenerator $class) : \Zend\Code\Generator\FileGenerator

Parameters

$class

arraystring\Zend\Code\Generator\ClassGenerator

Exceptions

\Zend\Code\Generator\Exception\InvalidArgumentException

Returns

\Zend\Code\Generator\FileGenerator

setClasses()

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

Parameters

$classes

array

Returns

\Zend\Code\Generator\FileGenerator

setDocBlock()

setDocBlock(\Zend\Code\Generator\DocBlockGenerator|array|string $docBlock) : \Zend\Code\Generator\FileGenerator

Parameters

$docBlock

\Zend\Code\Generator\DocBlockGeneratorarraystring

Exceptions

\Zend\Code\Generator\Exception\InvalidArgumentException

Returns

\Zend\Code\Generator\FileGenerator

setFilename()

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

Parameters

$filename

string

Returns

\Zend\Code\Generator\FileGenerator

setIndentation()

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

Parameters

$indentation

string

Returns

\Zend\Code\Generator\AbstractGenerator

setNamespace()

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

Parameters

$namespace

string

Returns

\Zend\Code\Generator\FileGenerator

setOptions()

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

Parameters

$options

array\Traversable

Exceptions

\Zend\Code\Generator\Exception\InvalidArgumentException

Returns

\Zend\Code\Generator\AbstractGenerator

setRequiredFiles()

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

Parameters

$requiredFiles

array

Returns

\Zend\Code\Generator\FileGenerator

setSourceContent()

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

Parameters

$sourceContent

string

Returns

\Zend\Code\Generator\AbstractGenerator

setSourceDirty()

setSourceDirty(boolean $isSourceDirty = true) : \Zend\Code\Generator\AbstractGenerator
Inherited

Parameters

$isSourceDirty

boolean

Returns

\Zend\Code\Generator\AbstractGenerator

setUse()

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

Parameters

$use

string

$as

nullstring

Returns

\Zend\Code\Generator\FileGenerator

setUses()

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

Parameters

$uses

array

Returns

\Zend\Code\Generator\FileGenerator

write()

write() : \Zend\Code\Generator\FileGenerator

Exceptions

\Zend\Code\Generator\Exception\RuntimeException

Returns

\Zend\Code\Generator\FileGenerator

 Properties

 

$body

$body : string

Default

null
 

$classes

$classes : array

Default

array()
 

$docBlock

$docBlock : \Zend\Code\Generator\DocBlockGenerator

Default

null
 

$filename

$filename : string

Default

null
 

4 spaces by default

$indentation : integer | string

Default

' '
 

$isSourceDirty

$isSourceDirty : boolean

Default

true
 

$namespace

$namespace : string

Default

null
 

$requiredFiles

$requiredFiles : array

Default

array()
 

$sourceContent

$sourceContent : string

Default

null
 

$uses

$uses : array

Default

array()

 Constants

 

Line feed to use in place of EOL

LINE_FEED = "\n"