Documentation

BaseNode
in package
implements NodeInterface

The base node class.

Tags
author

Johannes M. Schmitt schmittjoh@gmail.com

Interfaces, Classes and Traits

NodeInterface
Common Interface among all nodes.

Table of Contents

DEFAULT_PATH_SEPARATOR  = '.'
$allowOverwrite  : mixed
$attributes  : mixed
$deprecation  : mixed
$equivalentValues  : mixed
$finalValidationClosures  : mixed
$name  : mixed
$normalizationClosures  : mixed
$parent  : mixed
$pathSeparator  : mixed
$required  : mixed
$handlingPlaceholder  : mixed
$placeholders  : mixed
$placeholderUniquePrefixes  : mixed
__construct()  : mixed
addEquivalentValue()  : mixed
Adds an equivalent value.
finalize()  : mixed
Finalizes a value.
getAttribute()  : mixed
getAttributes()  : array<string|int, mixed>
getDeprecation()  : array<string|int, mixed>
getDeprecationMessage()  : string
Returns the deprecated message.
getExample()  : string|array<string|int, mixed>|null
Retrieves the example configuration for this node.
getInfo()  : string|null
Returns info message.
getName()  : string
Returns the name of the node.
getParent()  : NodeInterface|null
Returns parent node for this node.
getPath()  : string
Returns the path of the node.
hasAttribute()  : bool
isDeprecated()  : bool
Checks if this node is deprecated.
isRequired()  : bool
Returns true when the node is required.
merge()  : mixed
Merges two values together.
normalize()  : mixed
Normalizes a value.
removeAttribute()  : mixed
setAllowOverwrite()  : mixed
Sets if this node can be overridden.
setAttribute()  : mixed
setAttributes()  : mixed
setDeprecated()  : mixed
Sets this node as deprecated.
setExample()  : mixed
Sets the example configuration for this node.
setFinalValidationClosures()  : mixed
Sets the closures used for final validation.
setInfo()  : mixed
Sets an info message.
setNormalizationClosures()  : mixed
Sets the closures used for normalization.
setRequired()  : mixed
Set this node as required.
allowPlaceholders()  : bool
Tests if placeholder values are allowed for this node.
finalizeValue()  : mixed
Finalizes a value.
getValidPlaceholderTypes()  : array<string|int, mixed>
Gets allowed dynamic types for this node.
isHandlingPlaceholder()  : bool
Tests if a placeholder is being handled currently.
mergeValues()  : mixed
Merges two values together.
normalizeValue()  : mixed
Normalizes the value.
preNormalize()  : mixed
Normalizes the value before any other normalization is applied.
validateType()  : mixed
Validates the type of a Node.
doValidateType()  : void
resolvePlaceholderValue()  : mixed

Constants

DEFAULT_PATH_SEPARATOR

public mixed DEFAULT_PATH_SEPARATOR = '.'

Properties

$allowOverwrite

protected mixed $allowOverwrite = true

$attributes

protected mixed $attributes = []

$deprecation

protected mixed $deprecation = []

$equivalentValues

protected mixed $equivalentValues = []

$finalValidationClosures

protected mixed $finalValidationClosures = []

$normalizationClosures

protected mixed $normalizationClosures = []

$pathSeparator

protected mixed $pathSeparator

$required

protected mixed $required = false

$handlingPlaceholder

private mixed $handlingPlaceholder

$placeholders

private static mixed $placeholders = []

$placeholderUniquePrefixes

private static mixed $placeholderUniquePrefixes = []

Methods

__construct()

public __construct(string|null $name[, NodeInterface|null $parent = null ][, string $pathSeparator = self::DEFAULT_PATH_SEPARATOR ]) : mixed
Parameters
$name : string|null
$parent : NodeInterface|null = null
$pathSeparator : string = self::DEFAULT_PATH_SEPARATOR
Tags
throws
InvalidArgumentException

if the name contains a period

Return values
mixed

addEquivalentValue()

Adds an equivalent value.

public addEquivalentValue(mixed $originalValue, mixed $equivalentValue) : mixed
Parameters
$originalValue : mixed
$equivalentValue : mixed
Return values
mixed

finalize()

Finalizes a value.

public final finalize(mixed $value) : mixed
Parameters
$value : mixed

The value to finalize

Return values
mixed

getAttribute()

public getAttribute(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string
$default : mixed = null
Return values
mixed

getAttributes()

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

getDeprecation()

public getDeprecation(string $node, string $path) : array<string|int, mixed>
Parameters
$node : string

The configuration node name

$path : string

The path of the node

Return values
array<string|int, mixed>

getDeprecationMessage()

Returns the deprecated message.

public getDeprecationMessage(string $node, string $path) : string
Parameters
$node : string

the configuration node name

$path : string

the path of the node

Tags
deprecated

since Symfony 5.1, use "getDeprecation()" instead.

Return values
string

getExample()

Retrieves the example configuration for this node.

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

getInfo()

Returns info message.

public getInfo() : string|null
Return values
string|null

getName()

Returns the name of the node.

public getName() : string
Return values
string

getPath()

Returns the path of the node.

public getPath() : string
Return values
string

hasAttribute()

public hasAttribute(string $key) : bool
Parameters
$key : string
Return values
bool

isDeprecated()

Checks if this node is deprecated.

public isDeprecated() : bool
Return values
bool

isRequired()

Returns true when the node is required.

public isRequired() : bool
Return values
bool

merge()

Merges two values together.

public final merge(mixed $leftSide, mixed $rightSide) : mixed
Parameters
$leftSide : mixed
$rightSide : mixed
Return values
mixed

normalize()

Normalizes a value.

public final normalize(mixed $value) : mixed
Parameters
$value : mixed

The value to normalize

Return values
mixed

removeAttribute()

public removeAttribute(string $key) : mixed
Parameters
$key : string
Return values
mixed

setAllowOverwrite()

Sets if this node can be overridden.

public setAllowOverwrite(bool $allow) : mixed
Parameters
$allow : bool
Return values
mixed

setAttribute()

public setAttribute(string $key, mixed $value) : mixed
Parameters
$key : string
$value : mixed
Return values
mixed

setAttributes()

public setAttributes(array<string|int, mixed> $attributes) : mixed
Parameters
$attributes : array<string|int, mixed>
Return values
mixed

setDeprecated()

Sets this node as deprecated.

public setDeprecated(string $package) : mixed
Parameters
$package : string

The name of the composer package that is triggering the deprecation

Return values
mixed

setExample()

Sets the example configuration for this node.

public setExample(string|array<string|int, mixed> $example) : mixed
Parameters
$example : string|array<string|int, mixed>
Return values
mixed

setFinalValidationClosures()

Sets the closures used for final validation.

public setFinalValidationClosures(array<string|int, Closure$closures) : mixed
Parameters
$closures : array<string|int, Closure>

An array of Closures used for final validation

Return values
mixed

setInfo()

Sets an info message.

public setInfo(string $info) : mixed
Parameters
$info : string
Return values
mixed

setNormalizationClosures()

Sets the closures used for normalization.

public setNormalizationClosures(array<string|int, Closure$closures) : mixed
Parameters
$closures : array<string|int, Closure>

An array of Closures used for normalization

Return values
mixed

setRequired()

Set this node as required.

public setRequired(bool $boolean) : mixed
Parameters
$boolean : bool
Return values
mixed

allowPlaceholders()

Tests if placeholder values are allowed for this node.

protected allowPlaceholders() : bool
Return values
bool

finalizeValue()

Finalizes a value.

protected abstract finalizeValue(mixed $value) : mixed
Parameters
$value : mixed

The value to finalize

Return values
mixed

getValidPlaceholderTypes()

Gets allowed dynamic types for this node.

protected getValidPlaceholderTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>

isHandlingPlaceholder()

Tests if a placeholder is being handled currently.

protected isHandlingPlaceholder() : bool
Return values
bool

mergeValues()

Merges two values together.

protected abstract mergeValues(mixed $leftSide, mixed $rightSide) : mixed
Parameters
$leftSide : mixed
$rightSide : mixed
Return values
mixed

normalizeValue()

Normalizes the value.

protected abstract normalizeValue(mixed $value) : mixed
Parameters
$value : mixed

The value to normalize

Return values
mixed

preNormalize()

Normalizes the value before any other normalization is applied.

protected preNormalize(mixed $value) : mixed
Parameters
$value : mixed
Return values
mixed

validateType()

Validates the type of a Node.

protected abstract validateType(mixed $value) : mixed
Parameters
$value : mixed

The value to validate

Tags
throws
InvalidTypeException

when the value is invalid

Return values
mixed

doValidateType()

private doValidateType(mixed $value) : void
Parameters
$value : mixed
Return values
void

resolvePlaceholderValue()

private static resolvePlaceholderValue(mixed $value) : mixed
Parameters
$value : mixed
Return values
mixed

Search results