MagicUnset
extends MagicMethodGenerator
in package
Magic `__unset` method for remote objects
Table of Contents
Constants
- FLAG_ABSTRACT = 0x1
- FLAG_FINAL = 0x2
- FLAG_INTERFACE = 0x8
- FLAG_PRIVATE = 0x40
- FLAG_PROTECTED = 0x20
- FLAG_PUBLIC = 0x10
- FLAG_STATIC = 0x4
- LINE_FEED = "\n"
- Line feed to use in place of EOL
- VISIBILITY_PRIVATE = 'private'
- VISIBILITY_PROTECTED = 'protected'
- VISIBILITY_PUBLIC = 'public'
Properties
- $body : string
- $docBlock : DocBlockGenerator|null
- $flags : int
- $hasTentativeReturnType : mixed
- $indentation : string
- $isSourceDirty : bool
- $name : string
- $parameters : array<string|int, ParameterGenerator>
- $sourceContent : string|null
- TODO: Type should be changed to "string" in the next major version. Nullable for BC
- $returnsReference : bool
- $returnType : TypeGenerator|null
Methods
- __construct() : mixed
- Constructor
- __toString() : string
- addFlag() : AbstractMemberGenerator
- copyMethodSignature() : MethodGenerator
- Returns a MethodGenerator based on a MethodReflection with only the signature copied.
- fromArray() : MethodGenerator
- Generate from array
- fromReflection() : MethodGenerator
- fromReflectionWithoutBodyAndDocBlock() : static
- generate() : string
- getBody() : string
- getDocBlock() : DocBlockGenerator|null
- getIndentation() : string
- getName() : string
- getParameters() : array<string|int, ParameterGenerator>
- getReturnType() : TypeGenerator|null
- getSourceContent() : string|null
- getVisibility() : mixed
- isAbstract() : bool
- isFinal() : bool
- isInterface() : bool
- isSourceDirty() : bool
- isStatic() : bool
- removeDocBlock() : void
- removeFlag() : AbstractMemberGenerator
- returnsReference() : bool
- setAbstract() : AbstractMemberGenerator
- setBody() : MethodGenerator
- setDocBlock() : AbstractMemberGenerator
- setFinal() : AbstractMemberGenerator
- setFlags() : AbstractMemberGenerator
- setIndentation() : AbstractGenerator
- setInterface() : AbstractMemberGenerator
- setName() : AbstractMemberGenerator
- setOptions() : AbstractGenerator
- setParameter() : MethodGenerator
- setParameters() : MethodGenerator
- setReturnsReference() : MethodGenerator
- setReturnType() : MethodGenerator
- setSourceContent() : AbstractGenerator
- setSourceDirty() : AbstractGenerator
- setStatic() : AbstractMemberGenerator
- setVisibility() : AbstractMemberGenerator
- clearBodyIndention() : string
- Identify the space indention from the first line and remove this indention from all lines
- sortParameters() : void
- Sort parameters by their position
Constants
FLAG_ABSTRACT
public
mixed
FLAG_ABSTRACT
= 0x1
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_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
$body
protected
string
$body
= ''
$docBlock
protected
DocBlockGenerator|null
$docBlock
= null
$flags
protected
int
$flags
= self::FLAG_PUBLIC
$hasTentativeReturnType
protected
mixed
$hasTentativeReturnType
= false
$indentation
protected
string
$indentation
= ' '
4 spaces by default
$isSourceDirty
protected
bool
$isSourceDirty
= true
$name
protected
string
$name
= ''
$parameters
protected
array<string|int, ParameterGenerator>
$parameters
= []
$sourceContent
TODO: Type should be changed to "string" in the next major version. Nullable for BC
protected
string|null
$sourceContent
= null
$returnsReference
private
bool
$returnsReference
= false
$returnType
private
TypeGenerator|null
$returnType
= null
Methods
__construct()
Constructor
public
__construct(ReflectionClass $originalClass, PropertyGenerator $adapterProperty) : mixed
Parameters
- $originalClass : ReflectionClass
- $adapterProperty : PropertyGenerator
Tags
__toString()
public
__toString() : string
Return values
stringaddFlag()
public
addFlag(int $flag) : AbstractMemberGenerator
Parameters
- $flag : int
Return values
AbstractMemberGeneratorcopyMethodSignature()
Returns a MethodGenerator based on a MethodReflection with only the signature copied.
public
static copyMethodSignature(MethodReflection $reflectionMethod) : MethodGenerator
This is similar to fromReflection() but without the method body and phpdoc as this is quite heavy to copy. It's for example useful when creating proxies where you normally change the method body anyway.
Parameters
- $reflectionMethod : MethodReflection
Return values
MethodGeneratorfromArray()
Generate from array
public
static fromArray(array<string|int, mixed> $array) : MethodGenerator
Parameters
- $array : array<string|int, mixed>
Tags
Return values
MethodGeneratorfromReflection()
public
static fromReflection(MethodReflection $reflectionMethod) : MethodGenerator
Parameters
- $reflectionMethod : MethodReflection
Return values
MethodGeneratorfromReflectionWithoutBodyAndDocBlock()
public
static fromReflectionWithoutBodyAndDocBlock(MethodReflection $reflectionMethod) : static
Parameters
- $reflectionMethod : MethodReflection
Return values
staticgenerate()
public
generate() : string
Return values
stringgetBody()
public
getBody() : string
Return values
stringgetDocBlock()
public
getDocBlock() : DocBlockGenerator|null
Return values
DocBlockGenerator|nullgetIndentation()
public
getIndentation() : string
Return values
stringgetName()
public
getName() : string
Return values
stringgetParameters()
public
getParameters() : array<string|int, ParameterGenerator>
Return values
array<string|int, ParameterGenerator>getReturnType()
public
getReturnType() : TypeGenerator|null
Return values
TypeGenerator|nullgetSourceContent()
public
getSourceContent() : string|null
Return values
string|nullgetVisibility()
public
getVisibility() : mixed
Tags
isAbstract()
public
isAbstract() : bool
Return values
boolisFinal()
public
isFinal() : bool
Return values
boolisInterface()
public
isInterface() : bool
Return values
boolisSourceDirty()
public
isSourceDirty() : bool
Return values
boolisStatic()
public
isStatic() : bool
Return values
boolremoveDocBlock()
public
removeDocBlock() : void
removeFlag()
public
removeFlag(int $flag) : AbstractMemberGenerator
Parameters
- $flag : int
Return values
AbstractMemberGeneratorreturnsReference()
public
returnsReference() : bool
Return values
boolsetAbstract()
public
setAbstract(bool $isAbstract) : AbstractMemberGenerator
Parameters
- $isAbstract : bool
Return values
AbstractMemberGeneratorsetBody()
public
setBody(string $body) : MethodGenerator
Parameters
- $body : string
Return values
MethodGeneratorsetDocBlock()
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
AbstractGeneratorsetParameter()
public
setParameter(ParameterGenerator|array<string|int, mixed>|string $parameter) : MethodGenerator
Parameters
- $parameter : ParameterGenerator|array<string|int, mixed>|string
Tags
Return values
MethodGeneratorsetParameters()
public
setParameters(array<string|int, ParameterGenerator>|array<string|int, array<string|int, mixed>>|array<string|int, string> $parameters) : MethodGenerator
Parameters
- $parameters : array<string|int, ParameterGenerator>|array<string|int, array<string|int, mixed>>|array<string|int, string>
Return values
MethodGeneratorsetReturnsReference()
public
setReturnsReference(bool $returnsReference) : MethodGenerator
Parameters
- $returnsReference : bool
Return values
MethodGeneratorsetReturnType()
public
setReturnType([string|null $returnType = null ]) : MethodGenerator
Parameters
- $returnType : string|null = null
Return values
MethodGeneratorsetSourceContent()
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
AbstractMemberGeneratorsetVisibility()
public
setVisibility(string $visibility) : AbstractMemberGenerator
Parameters
- $visibility : string
Return values
AbstractMemberGeneratorclearBodyIndention()
Identify the space indention from the first line and remove this indention from all lines
protected
static clearBodyIndention(string $body) : string
Parameters
- $body : string
Return values
stringsortParameters()
Sort parameters by their position
private
sortParameters() : void