UnsetPropertiesGenerator
in package
FinalYes
Generates code necessary to unset all the given properties from a particular given instance string name
Table of Contents
Constants
- CLOSURE_TEMPLATE = <<<'PHP' \Closure::bind(function (\%s $instance) { %s }, $%s, %s)->__invoke($%s); PHP
Methods
- generateSnippet() : string
- generateUnsetClassScopedPropertiesBlock() : string
- generateUnsetNonScopedPropertiesCode() : string
- generateUnsetScopedPropertiesCode() : string
- generateUnsetStatement() : string
Constants
CLOSURE_TEMPLATE
private
mixed
CLOSURE_TEMPLATE
= <<<'PHP'
\Closure::bind(function (\%s $instance) {
%s
}, $%s, %s)->__invoke($%s);
PHP
Methods
generateSnippet()
public
static generateSnippet(Properties $properties, string $instanceName) : string
Parameters
- $properties : Properties
- $instanceName : string
Return values
stringgenerateUnsetClassScopedPropertiesBlock()
private
static generateUnsetClassScopedPropertiesBlock(ReflectionClass $declaringClass, array<string, ReflectionProperty> $properties, string $instanceName) : string
Parameters
- $declaringClass : ReflectionClass
- $properties : array<string, ReflectionProperty>
- $instanceName : string
Return values
stringgenerateUnsetNonScopedPropertiesCode()
private
static generateUnsetNonScopedPropertiesCode(array<string, ReflectionProperty> $nonScopedProperties, string $instanceName) : string
Parameters
- $nonScopedProperties : array<string, ReflectionProperty>
- $instanceName : string
Return values
stringgenerateUnsetScopedPropertiesCode()
private
static generateUnsetScopedPropertiesCode(array<class-string, array<string, ReflectionProperty>> $scopedPropertyGroups, string $instanceName) : string
Parameters
- $scopedPropertyGroups : array<class-string, array<string, ReflectionProperty>>
- $instanceName : string
Return values
stringgenerateUnsetStatement()
private
static generateUnsetStatement(array<string, ReflectionProperty> $properties, string $instanceName) : string
Parameters
- $properties : array<string, ReflectionProperty>
- $instanceName : string