PHP Class Zend\Code\Generator\ValueGenerator

Inheritance: extends Zend\Code\Generator\AbstractGenerator
ファイルを表示 Open project: zendframework/zend-code Class Usage Examples

Protected Properties

Property Type Description
$allowedTypes array
$arrayDepth integer
$constants ArrayObject | Zend\Stdlib\ArrayObject Autodetectable constants
$outputMode string
$type string
$value mixed

Public Methods

Method Description
__construct ( mixed $value = null, string $type = self::TYPE_AUTO, string $outputMode = self::OUTPUT_MULTIPLE_LINE, null | ArrayObject | Zend\Stdlib\ArrayObject $constants = null )
__toString ( )
addConstant ( string $constant ) Add constant to list
deleteConstant ( string $constant ) : boolean Delete constant from constant list
escape ( string $input, boolean $quote = true ) : string Quotes value for PHP code.
generate ( ) : string
getArrayDepth ( ) : integer
getAutoDeterminedType ( mixed $value ) : string
getConstants ( ) : ArrayObject | Zend\Stdlib\ArrayObject Return constant list
getOutputMode ( ) : string
getType ( ) : string
getValue ( ) : mixed
initEnvironmentConstants ( ) Init constant list by defined and magic constants
isValidConstantType ( ) : boolean
setArrayDepth ( integer $arrayDepth ) : ValueGenerator
setOutputMode ( string $outputMode ) : ValueGenerator
setType ( string $type ) : ValueGenerator
setValue ( mixed $value ) : ValueGenerator

Protected Methods

Method Description
getValidatedType ( string $type ) : string

Method Details

__construct() public method

public __construct ( mixed $value = null, string $type = self::TYPE_AUTO, string $outputMode = self::OUTPUT_MULTIPLE_LINE, null | ArrayObject | Zend\Stdlib\ArrayObject $constants = null )
$value mixed
$type string
$outputMode string
$constants null | ArrayObject | Zend\Stdlib\ArrayObject

__toString() public method

public __toString ( )

addConstant() public method

Add constant to list
public addConstant ( string $constant )
$constant string

deleteConstant() public method

Delete constant from constant list
public deleteConstant ( string $constant ) : boolean
$constant string
return boolean

escape() public static method

Quotes value for PHP code.
public static escape ( string $input, boolean $quote = true ) : string
$input string Raw string.
$quote boolean Whether add surrounding quotes or not.
return string PHP-ready code.

generate() public method

public generate ( ) : string
return string

getArrayDepth() public method

public getArrayDepth ( ) : integer
return integer

getAutoDeterminedType() public method

public getAutoDeterminedType ( mixed $value ) : string
$value mixed
return string

getConstants() public method

Return constant list
public getConstants ( ) : ArrayObject | Zend\Stdlib\ArrayObject
return ArrayObject | Zend\Stdlib\ArrayObject

getOutputMode() public method

public getOutputMode ( ) : string
return string

getType() public method

public getType ( ) : string
return string

getValidatedType() protected method

protected getValidatedType ( string $type ) : string
$type string
return string

getValue() public method

public getValue ( ) : mixed
return mixed

initEnvironmentConstants() public method

Init constant list by defined and magic constants

isValidConstantType() public method

public isValidConstantType ( ) : boolean
return boolean

setArrayDepth() public method

public setArrayDepth ( integer $arrayDepth ) : ValueGenerator
$arrayDepth integer
return ValueGenerator

setOutputMode() public method

public setOutputMode ( string $outputMode ) : ValueGenerator
$outputMode string
return ValueGenerator

setType() public method

public setType ( string $type ) : ValueGenerator
$type string
return ValueGenerator

setValue() public method

public setValue ( mixed $value ) : ValueGenerator
$value mixed
return ValueGenerator

Property Details

$allowedTypes protected_oe property

protected array $allowedTypes
return array

$arrayDepth protected_oe property

protected int $arrayDepth
return integer

$constants protected_oe property

Autodetectable constants
protected ArrayObject|ArrayObject,Zend\Stdlib $constants
return ArrayObject | Zend\Stdlib\ArrayObject

$outputMode protected_oe property

protected string $outputMode
return string

$type protected_oe property

protected string $type
return string

$value protected_oe property

protected mixed $value
return mixed