package Default
inherited_from \Zend\Code\Generator\AbstractGenerator

 Methods

__construct()

__construct(mixed $value = null, string $type = self::TYPE_AUTO, string $outputMode = self::OUTPUT_MULTIPLE_LINE, \Zend\Stdlib\ArrayObject $constants = null
inherited_from \Zend\Code\Generator\AbstractGenerator::__construct()

Parameters

$value

mixed

$type

string

$outputMode

string

$constants

\Zend\Stdlib\ArrayObject

__construct()

__construct(array $options = array()
Inherited

Parameters

$options

array

__toString()

__toString() 

Add constant to list

addConstant(string $constant) : \Zend\Code\Generator\ValueGenerator
fluent This method is part of a fluent interface and will return the same instance

Parameters

$constant

string

Returns

\Zend\Code\Generator\ValueGenerator

Delete constant from constant list

deleteConstant(string $constant) : boolean

Parameters

$constant

string

Returns

boolean

Quotes value for PHP code.

escape(string $input, boolean $quote = true) : string
Static

Parameters

$input

string

Raw string.

$quote

boolean

Whether add surrounding quotes or not.

Returns

stringPHP-ready code.

generate()

generate() : string

Exceptions

\Zend\Code\Generator\Exception\RuntimeException

Returns

string

getArrayDepth()

getArrayDepth() : integer

Returns

integer

getAutoDeterminedType()

getAutoDeterminedType(mixed $value) : string

Parameters

$value

mixed

Returns

string

Return constant list

getConstants() : \Zend\Stdlib\ArrayObject

Returns

\Zend\Stdlib\ArrayObject

getIndentation()

getIndentation() : string
Inherited

Returns

string

getOutputMode()

getOutputMode() : string

Returns

string

getSourceContent()

getSourceContent() : string
Inherited

Returns

string

getType()

getType() : string

Returns

string

getValue()

getValue() : mixed

Returns

mixed

Init constant list by defined and magic constants

initEnvironmentConstants() 

isSourceDirty()

isSourceDirty() : boolean
Inherited

Returns

boolean

isValidConstantType()

isValidConstantType() : boolean

Returns

boolean

setArrayDepth()

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

Parameters

$arrayDepth

integer

Returns

\Zend\Code\Generator\ValueGenerator

setIndentation()

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

Parameters

$indentation

string

Returns

\Zend\Code\Generator\AbstractGenerator

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

setOutputMode()

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

Parameters

$outputMode

string

Returns

\Zend\Code\Generator\ValueGenerator

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

setType()

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

Parameters

$type

string

Returns

\Zend\Code\Generator\ValueGenerator

setValue()

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

Parameters

$value

mixed

Returns

\Zend\Code\Generator\ValueGenerator

getValidatedType()

getValidatedType(string $type) : string

Parameters

$type

string

Returns

string

 Properties

 

$allowedTypes

$allowedTypes : array

Default

null
 

$arrayDepth

$arrayDepth : integer

Default

0
 

Autodetectable constants

$constants : \Zend\Stdlib\ArrayObject

Default

null
 

4 spaces by default

$indentation : integer | string

Default

' '
 

$isSourceDirty

$isSourceDirty : boolean

Default

true
 

$outputMode

$outputMode : string

Default

self::OUTPUT_MULTIPLE_LINE
 

$sourceContent

$sourceContent : string

Default

null
 

$type

$type : string

Default

self::TYPE_AUTO
 

$value

$value : mixed

Default

null

 Constants

 

Line feed to use in place of EOL

LINE_FEED = "\n" 
 

OUTPUT_MULTIPLE_LINE

OUTPUT_MULTIPLE_LINE = 'multipleLine' 
 

OUTPUT_SINGLE_LINE

OUTPUT_SINGLE_LINE = 'singleLine' 
 

TYPE_ARRAY

TYPE_ARRAY = 'array' 
 

TYPE_AUTO

TYPE_AUTO = 'auto' 
 

TYPE_BOOL

TYPE_BOOL = 'bool' 
 

TYPE_BOOLEAN

TYPE_BOOLEAN = 'boolean' 
 

TYPE_CONSTANT

TYPE_CONSTANT = 'constant' 
 

TYPE_DOUBLE

TYPE_DOUBLE = 'double' 
 

TYPE_FLOAT

TYPE_FLOAT = 'float' 
 

TYPE_INT

TYPE_INT = 'int' 
 

TYPE_INTEGER

TYPE_INTEGER = 'integer' 
 

TYPE_NULL

TYPE_NULL = 'null' 
 

TYPE_NUMBER

TYPE_NUMBER = 'number' 
 

TYPE_OBJECT

TYPE_OBJECT = 'object' 
 

TYPE_OTHER

TYPE_OTHER = 'other' 
 

TYPE_STRING

TYPE_STRING = 'string'