Documentation

FixerOption
in package
implements FixerOptionInterface

FinalYes

Table of Contents

Interfaces

FixerOptionInterface

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

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>

getDescription()

public getDescription() : string
Return values
string

getName()

public getName() : string
Return values
string

getNormalizer()

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

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 Bug #69639 for details.

Parameters
$closure : Closure
Return values
Closure

        
On this page

Search results