Methods

__construct()

__construct(mixed $value, string $type, string $outputMode, \Zend\Stdlib\ArrayObject $constants) 

Parameters

$value

mixed

$type

string

$outputMode

string

__toString()

__toString() 

Add constant to list

addConstant(string $constant) : \Zend\Code\Generator\$this

Parameters

$constant

string

Returns

\Zend\Code\Generator\$this

Delete constant from constant list

deleteConstant(string $constant) : bool

Parameters

$constant

string

Returns

bool

Quotes value for PHP code.

escape(string $input, bool $quote) : string

Parameters

$input

string

Raw string.

$quote

bool

Whether add surrounding quotes or not.

Returns

stringPHP-ready code.

generate()

generate() : string

getArrayDepth()

getArrayDepth() : int

Returns

int

getAutoDeterminedType()

getAutoDeterminedType(mixed $value) : string

Parameters

$value

mixed

Returns

string

Return constant list

getConstants() : \Zend\Stdlib\ArrayObject

getIndentation()

getIndentation() : string
Inherited

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

Returns

string

getOutputMode()

getOutputMode() : string

Returns

string

getSourceContent()

getSourceContent() : string
Inherited

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

Returns

string

getType()

getType() : string

Returns

string

getValue()

getValue() : mixed

Returns

mixed

Init constant list by defined and magic constants

initEnvironmentConstants() 

isSourceDirty()

isSourceDirty() : bool
Inherited

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

Returns

bool

isValidConstantType()

isValidConstantType() : bool

Returns

bool

setArrayDepth()

setArrayDepth(int $arrayDepth) : \Zend\Code\Generator\ValueGenerator

Parameters

$arrayDepth

int

Returns

setIndentation()

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

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

Parameters

$indentation

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

setOutputMode()

setOutputMode(string $outputMode) : \Zend\Code\Generator\ValueGenerator

Parameters

$outputMode

string

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

setType()

setType(string $type) : \Zend\Code\Generator\ValueGenerator

Parameters

$type

string

Returns

setValue()

setValue(mixed $value) : \Zend\Code\Generator\ValueGenerator

Parameters

$value

mixed

Returns

getValidatedType()

getValidatedType(string $type) : string

Parameters

$type

string

Returns

string

 Properties

 

$allowedTypes

$allowedTypes : array

 

$arrayDepth

$arrayDepth : int

 

Autodetectable constants

$constants : \Zend\Stdlib\ArrayObject

 

<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
 

$outputMode

$outputMode : string

 

$sourceContent

$sourceContent : string
Inherited

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

$type

$type : string

 

$value

$value : mixed

 Constants

 

Line feed to use in place of EOL

LINE_FEED 
Inherited

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

OUTPUT_MULTIPLE_LINE

OUTPUT_MULTIPLE_LINE 

 

OUTPUT_SINGLE_LINE

OUTPUT_SINGLE_LINE 

 

TYPE_ARRAY

TYPE_ARRAY 

 

TYPE_AUTO

TYPE_AUTO 

 

TYPE_BOOL

TYPE_BOOL 

 

TYPE_BOOLEAN

TYPE_BOOLEAN 

 

TYPE_CONSTANT

TYPE_CONSTANT 

 

TYPE_DOUBLE

TYPE_DOUBLE 

 

TYPE_FLOAT

TYPE_FLOAT 

 

TYPE_INT

TYPE_INT 

 

TYPE_INTEGER

TYPE_INTEGER 

 

TYPE_NULL

TYPE_NULL 

 

TYPE_NUMBER

TYPE_NUMBER 

 

TYPE_OBJECT

TYPE_OBJECT 

 

TYPE_OTHER

TYPE_OTHER 

 

TYPE_STRING

TYPE_STRING