Documentation

FixerOption
in package
implements FixerOptionInterface

Interfaces, Classes and Traits

FixerOptionInterface

Table of Contents

$allowedTypes  : null|array<string|int, string>
$allowedValues  : null|array<string|int, mixed>
$default  : mixed
$description  : string
$isRequired  : bool
$name  : string
$normalizer  : null|Closure
__construct()  : mixed
getAllowedTypes()  : null|array<string|int, string>
getAllowedValues()  : null|array<string|int, mixed>
getDefault()  : mixed
getDescription()  : string
getName()  : string
getNormalizer()  : null|Closure
hasDefault()  : bool
unbind()  : Closure
Unbinds the given closure to avoid memory leaks.

Properties

$allowedTypes

private null|array<string|int, string> $allowedTypes

$allowedValues

private null|array<string|int, mixed> $allowedValues

Methods

__construct()

public __construct(string $name, string $description[, bool $isRequired = true ][, mixed $default = null ][, null|array<string|int, string> $allowedTypes = null ][, array<string|int, mixed> $allowedValues = null ][, Closure $normalizer = null ]) : mixed
Parameters
$name : string
$description : string
$isRequired : bool = true
$default : mixed = null
$allowedTypes : null|array<string|int, string> = null
$allowedValues : array<string|int, mixed> = null
$normalizer : Closure = null
Return values
mixed

getAllowedTypes()

public getAllowedTypes() : null|array<string|int, string>
Return values
null|array<string|int, string>

getAllowedValues()

public getAllowedValues() : null|array<string|int, mixed>
Return values
null|array<string|int, mixed>

getDefault()

public getDefault() : mixed
Return values
mixed

getDescription()

public getDescription() : string
Return values
string

getName()

public getName() : string
Return values
string

getNormalizer()

public getNormalizer() : null|Closure
Return values
null|Closure

hasDefault()

public hasDefault() : bool
Return values
bool

unbind()

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 https://bugs.php.net/bug.php?id=69639 for details.

Parameters
$closure : Closure
Return values
Closure

Search results