Documentation

PropertyValueGenerator extends ValueGenerator
in package

Table of Contents

Constants

LINE_FEED  = "\n"
Line feed to use in place of EOL
OUTPUT_MULTIPLE_LINE  = 'multipleLine'
OUTPUT_SINGLE_LINE  = 'singleLine'
TYPE_ARRAY  = 'array'
TYPE_ARRAY_LONG  = 'array_long'
TYPE_ARRAY_SHORT  = 'array_short'
TYPE_AUTO  = 'auto'
TYPE_BOOL  = 'bool'
TYPE_BOOLEAN  = 'boolean'
TYPE_CONSTANT  = 'constant'
TYPE_DOUBLE  = 'double'
TYPE_FLOAT  = 'float'
TYPE_INT  = 'int'
TYPE_INTEGER  = 'integer'
TYPE_NULL  = 'null'
TYPE_NUMBER  = 'number'
TYPE_OBJECT  = 'object'
TYPE_OTHER  = 'other'
TYPE_STRING  = 'string'

Properties

$allowedTypes  : array<string|int, mixed>
$arrayDepth  : int
$constants  : ArrayObject|ArrayObject
Autodetectable constants
$indentation  : string
$isSourceDirty  : bool
$outputMode  : string
$sourceContent  : string|null
TODO: Type should be changed to "string" in the next major version. Nullable for BC
$type  : string
$value  : mixed

Methods

__construct()  : mixed
__toString()  : string
addConstant()  : $this
Add constant to list
deleteConstant()  : bool
Delete constant from constant list
escape()  : string
Quotes value for PHP code.
generate()  : string
getArrayDepth()  : int
getAutoDeterminedType()  : string
getConstants()  : ArrayObject|ArrayObject
Return constant list
getIndentation()  : string
getOutputMode()  : string
getSourceContent()  : string|null
getType()  : string
getValue()  : mixed
initEnvironmentConstants()  : mixed
Init constant list by defined and magic constants
isSourceDirty()  : bool
isValidConstantType()  : bool
setArrayDepth()  : ValueGenerator
setIndentation()  : AbstractGenerator
setOptions()  : AbstractGenerator
setOutputMode()  : ValueGenerator
setSourceContent()  : AbstractGenerator
setSourceDirty()  : AbstractGenerator
setType()  : ValueGenerator
setValue()  : ValueGenerator
getValidatedType()  : string

Constants

OUTPUT_MULTIPLE_LINE

public mixed OUTPUT_MULTIPLE_LINE = 'multipleLine'

OUTPUT_SINGLE_LINE

public mixed OUTPUT_SINGLE_LINE = 'singleLine'

Properties

$allowedTypes

protected array<string|int, mixed> $allowedTypes = []

$constants

Autodetectable constants

protected ArrayObject|ArrayObject $constants

$outputMode

protected string $outputMode = self::OUTPUT_MULTIPLE_LINE

$sourceContent

TODO: Type should be changed to "string" in the next major version. Nullable for BC

protected string|null $sourceContent = null

Methods

__construct()

public __construct([array<string|int, mixed> $options = [] ]) : mixed
Parameters
$options : array<string|int, mixed> = []

addConstant()

Add constant to list

public addConstant(string $constant) : $this
Parameters
$constant : string
Return values
$this

deleteConstant()

Delete constant from constant list

public deleteConstant(string $constant) : bool
Parameters
$constant : string
Return values
bool

escape()

Quotes value for PHP code.

public static escape(string $input[, bool $quote = true ]) : string
Parameters
$input : string

Raw string.

$quote : bool = true

Whether add surrounding quotes or not.

Return values
string

PHP-ready code.

getAutoDeterminedType()

public getAutoDeterminedType(mixed $value) : string
Parameters
$value : mixed
Return values
string

getConstants()

Return constant list

public getConstants() : ArrayObject|ArrayObject
Return values
ArrayObject|ArrayObject

getOutputMode()

public getOutputMode() : string
Return values
string

getSourceContent()

public getSourceContent() : string|null
Return values
string|null

initEnvironmentConstants()

Init constant list by defined and magic constants

public initEnvironmentConstants() : mixed

isValidConstantType()

public isValidConstantType() : bool
Return values
bool

getValidatedType()

protected getValidatedType(string $type) : string
Parameters
$type : string
Return values
string

        
On this page

Search results