FixerOption
in package
implements
FixerOptionInterface
FinalYes
Table of Contents
Interfaces
Properties
- $allowedTypes : null|array<int, string>
- $allowedValues : null|array<int, null|callable(mixed): bool|scalar>
- $default : mixed
- $description : string
- $isRequired : bool
- $name : string
- $normalizer : null|Closure
Methods
- __construct() : mixed
- getAllowedTypes() : null|array<int, string>
- getAllowedValues() : null|array<int, null|callable(mixed): bool|scalar>
- getDefault() : mixed
- getDescription() : string
- getName() : string
- getNormalizer() : Closure|null
- hasDefault() : bool
- unbind() : Closure
- Unbinds the given closure to avoid memory leaks.
Properties
$allowedTypes
private
null|array<int, string>
$allowedTypes
$allowedValues
private
null|array<int, null|callable(mixed): bool|scalar>
$allowedValues
$default
private
mixed
$default
$description
private
string
$description
$isRequired
private
bool
$isRequired
$name
private
string
$name
$normalizer
private
null|Closure
$normalizer
Methods
__construct()
public
__construct(string $name, string $description[, bool $isRequired = true ][, mixed $default = null ][, null|array<int, string> $allowedTypes = null ][, null|array<int, null|callable(mixed): bool|scalar> $allowedValues = null ][, Closure|null $normalizer = null ]) : mixed
Parameters
- $name : string
- $description : string
- $isRequired : bool = true
- $default : mixed = null
- $allowedTypes : null|array<int, string> = null
- $allowedValues : null|array<int, null|callable(mixed): bool|scalar> = null
- $normalizer : Closure|null = null
getAllowedTypes()
public
getAllowedTypes() : null|array<int, string>
Return values
null|array<int, string>getAllowedValues()
public
getAllowedValues() : null|array<int, null|callable(mixed): bool|scalar>
Return values
null|array<int, null|callable(mixed): bool|scalar>getDefault()
public
getDefault() : mixed
getDescription()
public
getDescription() : string
Return values
stringgetName()
public
getName() : string
Return values
stringgetNormalizer()
public
getNormalizer() : Closure|null
Return values
Closure|nullhasDefault()
public
hasDefault() : bool
Return values
boolunbind()
Unbinds the given closure to avoid memory leaks.
private
unbind(Closure $closure) : Closure
The closures provided to this class were probably defined in a fixer class and thus bound to it by default. The configuration will then be stored in AbstractFixer::$configurationDefinition, leading to the following cyclic reference:
fixer -> configuration definition -> options -> closures -> fixer
This cyclic reference prevent the garbage collector to free memory as all elements are still referenced.
See Bug #69639 for details.
Parameters
- $closure : Closure