InitializerProperty
extends PropertyGenerator
in package
Property that contains the initializer for a lazy object
Table of Contents
Constants
- FLAG_ABSTRACT = 0x1
- FLAG_CONSTANT = 0x8
- FLAG_FINAL = 0x2
- FLAG_INTERFACE = 0x8
- FLAG_PRIVATE = 0x40
- FLAG_PROTECTED = 0x20
- FLAG_PUBLIC = 0x10
- FLAG_READONLY = 0x80
- FLAG_STATIC = 0x4
- LINE_FEED = "\n"
- Line feed to use in place of EOL
- VISIBILITY_PRIVATE = 'private'
- VISIBILITY_PROTECTED = 'protected'
- VISIBILITY_PUBLIC = 'public'
Properties
- $defaultValue : PropertyValueGenerator|null
- $docBlock : DocBlockGenerator|null
- $flags : int
- $indentation : string
- $isConst : bool
- $isSourceDirty : bool
- $name : string
- $sourceContent : string|null
- TODO: Type should be changed to "string" in the next major version. Nullable for BC
- $type : TypeGenerator|null
- $omitDefaultValue : bool
Methods
- __construct() : mixed
- Constructor
- addFlag() : AbstractMemberGenerator
- fromArray() : static
- Generate from array
- fromReflection() : static
- generate() : string
- getDefaultValue() : PropertyValueGenerator|null
- getDocBlock() : DocBlockGenerator|null
- getIndentation() : string
- getName() : string
- getSourceContent() : string|null
- getType() : TypeGenerator|null
- getVisibility() : mixed
- isAbstract() : bool
- isConst() : bool
- isFinal() : bool
- isInterface() : bool
- isReadonly() : bool
- isSourceDirty() : bool
- isStatic() : bool
- omitDefaultValue() : PropertyGenerator
- removeDocBlock() : void
- removeFlag() : AbstractMemberGenerator
- setAbstract() : AbstractMemberGenerator
- setConst() : PropertyGenerator
- setDefaultValue() : static
- setDocBlock() : AbstractMemberGenerator
- setFinal() : AbstractMemberGenerator
- setFlags() : AbstractMemberGenerator
- setIndentation() : AbstractGenerator
- setInterface() : AbstractMemberGenerator
- setName() : AbstractMemberGenerator
- setOptions() : AbstractGenerator
- setReadonly() : self
- setSourceContent() : AbstractGenerator
- setSourceDirty() : AbstractGenerator
- setStatic() : AbstractMemberGenerator
- setType() : void
- setVisibility() : AbstractMemberGenerator
Constants
FLAG_ABSTRACT
public
mixed
FLAG_ABSTRACT
= 0x1
FLAG_CONSTANT
public
mixed
FLAG_CONSTANT
= 0x8
FLAG_FINAL
public
mixed
FLAG_FINAL
= 0x2
FLAG_INTERFACE
public
mixed
FLAG_INTERFACE
= 0x8
FLAG_PRIVATE
public
mixed
FLAG_PRIVATE
= 0x40
FLAG_PROTECTED
public
mixed
FLAG_PROTECTED
= 0x20
FLAG_PUBLIC
public
mixed
FLAG_PUBLIC
= 0x10
FLAG_READONLY
public
mixed
FLAG_READONLY
= 0x80
FLAG_STATIC
public
mixed
FLAG_STATIC
= 0x4
LINE_FEED
Line feed to use in place of EOL
public
mixed
LINE_FEED
= "\n"
VISIBILITY_PRIVATE
public
mixed
VISIBILITY_PRIVATE
= 'private'
VISIBILITY_PROTECTED
public
mixed
VISIBILITY_PROTECTED
= 'protected'
VISIBILITY_PUBLIC
public
mixed
VISIBILITY_PUBLIC
= 'public'
Properties
$defaultValue
protected
PropertyValueGenerator|null
$defaultValue
= null
$docBlock
protected
DocBlockGenerator|null
$docBlock
= null
$flags
protected
int
$flags
= self::FLAG_PUBLIC
$indentation
protected
string
$indentation
= ' '
4 spaces by default
$isConst
protected
bool
$isConst
= false
$isSourceDirty
protected
bool
$isSourceDirty
= true
$name
protected
string
$name
= ''
$sourceContent
TODO: Type should be changed to "string" in the next major version. Nullable for BC
protected
string|null
$sourceContent
= null
$type
protected
TypeGenerator|null
$type
= null
$omitDefaultValue
private
bool
$omitDefaultValue
= false
Methods
__construct()
Constructor
public
__construct() : mixed
Tags
addFlag()
public
addFlag(int $flag) : AbstractMemberGenerator
Parameters
- $flag : int
Return values
AbstractMemberGeneratorfromArray()
Generate from array
public
static fromArray(array<string|int, mixed> $array) : static
Parameters
- $array : array<string|int, mixed>
Tags
Return values
staticfromReflection()
public
static fromReflection(PropertyReflection $reflectionProperty) : static
Parameters
- $reflectionProperty : PropertyReflection
Return values
staticgenerate()
public
generate() : string
Tags
Return values
stringgetDefaultValue()
public
getDefaultValue() : PropertyValueGenerator|null
Return values
PropertyValueGenerator|nullgetDocBlock()
public
getDocBlock() : DocBlockGenerator|null
Return values
DocBlockGenerator|nullgetIndentation()
public
getIndentation() : string
Return values
stringgetName()
public
getName() : string
Return values
stringgetSourceContent()
public
getSourceContent() : string|null
Return values
string|nullgetType()
public
getType() : TypeGenerator|null
Return values
TypeGenerator|nullgetVisibility()
public
getVisibility() : mixed
Tags
isAbstract()
public
isAbstract() : bool
Return values
boolisConst()
public
isConst() : bool
Return values
boolisFinal()
public
isFinal() : bool
Return values
boolisInterface()
public
isInterface() : bool
Return values
boolisReadonly()
public
isReadonly() : bool
Return values
boolisSourceDirty()
public
isSourceDirty() : bool
Return values
boolisStatic()
public
isStatic() : bool
Return values
boolomitDefaultValue()
public
omitDefaultValue([bool $omit = true ]) : PropertyGenerator
Parameters
- $omit : bool = true
Return values
PropertyGeneratorremoveDocBlock()
public
removeDocBlock() : void
removeFlag()
public
removeFlag(int $flag) : AbstractMemberGenerator
Parameters
- $flag : int
Return values
AbstractMemberGeneratorsetAbstract()
public
setAbstract(bool $isAbstract) : AbstractMemberGenerator
Parameters
- $isAbstract : bool
Return values
AbstractMemberGeneratorsetConst()
public
setConst(bool $const) : PropertyGenerator
Parameters
- $const : bool
Return values
PropertyGeneratorsetDefaultValue()
public
setDefaultValue(PropertyValueGenerator|mixed $defaultValue[, string $defaultValueType = PropertyValueGenerator::TYPE_AUTO ][, string $defaultValueOutputMode = PropertyValueGenerator::OUTPUT_MULTIPLE_LINE ]) : static
Parameters
- $defaultValue : PropertyValueGenerator|mixed
- $defaultValueType : string = PropertyValueGenerator::TYPE_AUTO
- $defaultValueOutputMode : string = PropertyValueGenerator::OUTPUT_MULTIPLE_LINE
Return values
staticsetDocBlock()
public
setDocBlock(DocBlockGenerator|string $docBlock) : AbstractMemberGenerator
Parameters
- $docBlock : DocBlockGenerator|string
Tags
Return values
AbstractMemberGeneratorsetFinal()
public
setFinal(bool $isFinal) : AbstractMemberGenerator
Parameters
- $isFinal : bool
Return values
AbstractMemberGeneratorsetFlags()
public
setFlags(int|array<string|int, int> $flags) : AbstractMemberGenerator
Parameters
- $flags : int|array<string|int, int>
Return values
AbstractMemberGeneratorsetIndentation()
public
setIndentation(string $indentation) : AbstractGenerator
Parameters
- $indentation : string
Return values
AbstractGeneratorsetInterface()
public
setInterface(bool $isInterface) : AbstractMemberGenerator
Parameters
- $isInterface : bool
Return values
AbstractMemberGeneratorsetName()
public
setName(string $name) : AbstractMemberGenerator
Parameters
- $name : string
Return values
AbstractMemberGeneratorsetOptions()
public
setOptions(array<string|int, mixed>|Traversable $options) : AbstractGenerator
Parameters
- $options : array<string|int, mixed>|Traversable
Tags
Return values
AbstractGeneratorsetReadonly()
public
setReadonly(bool $readonly) : self
Parameters
- $readonly : bool
Return values
selfsetSourceContent()
public
setSourceContent(string|null $sourceContent) : AbstractGenerator
Parameters
- $sourceContent : string|null
Return values
AbstractGeneratorsetSourceDirty()
public
setSourceDirty([bool $isSourceDirty = true ]) : AbstractGenerator
Parameters
- $isSourceDirty : bool = true
Return values
AbstractGeneratorsetStatic()
public
setStatic(bool $isStatic) : AbstractMemberGenerator
Parameters
- $isStatic : bool
Return values
AbstractMemberGeneratorsetType()
public
setType(TypeGenerator|null $type) : void
Parameters
- $type : TypeGenerator|null
setVisibility()
public
setVisibility(string $visibility) : AbstractMemberGenerator
Parameters
- $visibility : string