Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • ArrayNodeDefinition
  • BooleanNodeDefinition
  • EnumNodeDefinition
  • ExprBuilder
  • FloatNodeDefinition
  • IntegerNodeDefinition
  • MergeBuilder
  • NodeBuilder
  • NodeDefinition
  • NormalizationBuilder
  • NumericNodeDefinition
  • ScalarNodeDefinition
  • TreeBuilder
  • ValidationBuilder
  • VariableNodeDefinition

Interfaces

  • NodeParentInterface
  • ParentNodeDefinitionInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo

Class ArrayNodeDefinition

This class provides a fluent interface for defining an array node.

Symfony\Component\Config\Definition\Builder\NodeDefinition implements Symfony\Component\Config\Definition\Builder\NodeParentInterface
Extended by Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition implements Symfony\Component\Config\Definition\Builder\ParentNodeDefinitionInterface
Namespace: Symfony\Component\Config\Definition\Builder
Author: Johannes M. Schmitt <schmittjoh@gmail.com>
Located at config/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php
Methods summary
public
# __construct( string $name, Symfony\Component\Config\Definition\Builder\NodeParentInterface $parent = null )

Constructor

Constructor

Parameters

$name
string
$name The name of the node
$parent
Symfony\Component\Config\Definition\Builder\NodeParentInterface
$parent The parent

Overrides

Symfony\Component\Config\Definition\Builder\NodeDefinition::__construct()
public
# setBuilder( Symfony\Component\Config\Definition\Builder\NodeBuilder $builder )

Sets a custom children builder.

Sets a custom children builder.

Parameters

$builder
Symfony\Component\Config\Definition\Builder\NodeBuilder
$builder A custom NodeBuilder

Implementation of

Symfony\Component\Config\Definition\Builder\ParentNodeDefinitionInterface::setBuilder()
public Symfony\Component\Config\Definition\Builder\NodeBuilder
# children( )

Returns a builder to add children nodes.

Returns a builder to add children nodes.

Returns

Symfony\Component\Config\Definition\Builder\NodeBuilder

Implementation of

Symfony\Component\Config\Definition\Builder\ParentNodeDefinitionInterface::children()
public Symfony\Component\Config\Definition\Builder\NodeDefinition
# prototype( string $type )

Sets a prototype for child nodes.

Sets a prototype for child nodes.

Parameters

$type
string
$type the type of node

Returns

Symfony\Component\Config\Definition\Builder\NodeDefinition
public Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
# addDefaultsIfNotSet( )

Adds the default value if the node is not set in the configuration.

Adds the default value if the node is not set in the configuration.

This method is applicable to concrete nodes only (not to prototype nodes). If this function has been called and the node is not set during the finalization phase, it's default value will be derived from its children default values.

Returns

Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
public Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
# addDefaultChildrenIfNoneSet( integer|string|array|null $children = null )

Adds children with a default value when none are defined.

Adds children with a default value when none are defined.

Parameters

$children
integer|string|array|null
$children The number of children|The child name|The children names to be added This method is applicable to prototype nodes only.

Returns

Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
public Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
# requiresAtLeastOneElement( )

Requires the node to have at least one element.

Requires the node to have at least one element.

This method is applicable to prototype nodes only.

Returns

Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
public Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
# disallowNewKeysInSubsequentConfigs( )

Disallows adding news keys in a subsequent configuration.

Disallows adding news keys in a subsequent configuration.

If used all keys have to be defined in the same configuration file.

Returns

Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
public Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
# fixXmlConfig( string $singular, string $plural = null )

Sets a normalization rule for XML configurations.

Sets a normalization rule for XML configurations.

Parameters

$singular
string
$singular The key to remap
$plural
string
$plural The plural of the key for irregular plurals

Returns

Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
public Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
# useAttributeAsKey( string $name, Boolean $removeKeyItem = true )

Sets the attribute which value is to be used as key.

Sets the attribute which value is to be used as key.

This is useful when you have an indexed array that should be an associative array. You can select an item from within the array to be the key of the particular item. For example, if "id" is the "key", then:
array( array('id' => 'my_name', 'foo' => 'bar'), );
becomes
array( 'my_name' => array('foo' => 'bar'), );

If you'd like "'id' => 'my_name'" to still be present in the resulting array, then you can set the second argument of this method to false.

This method is applicable to prototype nodes only.

Parameters

$name
string
$name The name of the key
$removeKeyItem
Boolean
$removeKeyItem Whether or not the key item should be removed.

Returns

Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
public Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
# canBeUnset( Boolean $allow = true )

Sets whether the node can be unset.

Sets whether the node can be unset.

Parameters

$allow
Boolean
$allow

Returns

Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
public Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
# canBeEnabled( )

Adds an "enabled" boolean to enable the current section.

Adds an "enabled" boolean to enable the current section.

By default, the section is disabled. If any configuration is specified then the node will be automatically enabled:

enableableArrayNode: {enabled: true, ...} # The config is enabled & default values get overridden enableableArrayNode: ~ # The config is enabled & use the default values enableableArrayNode: true # The config is enabled & use the default values enableableArrayNode: {other: value, ...} # The config is enabled & default values get overridden enableableArrayNode: {enabled: false, ...} # The config is disabled enableableArrayNode: false # The config is disabled

Returns

Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
public Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
# canBeDisabled( )

Adds an "enabled" boolean to enable the current section.

Adds an "enabled" boolean to enable the current section.

By default, the section is enabled.

Returns

Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
public Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
# performNoDeepMerging( )

Disables the deep merging of the node.

Disables the deep merging of the node.

Returns

Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
public Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
# ignoreExtraKeys( )

Allows extra config keys to be specified under an array without throwing an exception.

Allows extra config keys to be specified under an array without throwing an exception.

Those config values are simply ignored. This should be used only in special cases where you want to send an entire configuration array through a special tree that processes only part of the array.

Returns

Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
public Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
# normalizeKeys( Boolean $bool )

Sets key normalization.

Sets key normalization.

Parameters

$bool
Boolean
$bool Whether to enable key normalization

Returns

Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
public Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
# append( Symfony\Component\Config\Definition\Builder\NodeDefinition $node )

Appends a node definition.

Appends a node definition.

$node = new ArrayNodeDefinition() ->children() ->scalarNode('foo')->end() ->scalarNode('baz')->end() ->end() ->append($this->getBarNodeDefinition()) ;

Parameters

$node
Symfony\Component\Config\Definition\Builder\NodeDefinition
$node A NodeDefinition instance

Returns

Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
This node

Implementation of

Symfony\Component\Config\Definition\Builder\ParentNodeDefinitionInterface::append()
protected Symfony\Component\Config\Definition\Builder\NodeBuilder
# getNodeBuilder( )

Returns a node builder to be used to add children and prototype

Returns a node builder to be used to add children and prototype

Returns

Symfony\Component\Config\Definition\Builder\NodeBuilder
The node builder
protected NodeInterface
# createNode( )

Instantiate and configure the node according to this definition

Instantiate and configure the node according to this definition

Returns

NodeInterface
$node The node instance

Throws

Symfony\Component\Config\Definition\Exception\InvalidDefinitionException
When the definition is invalid
protected
# validateConcreteNode( Symfony\Component\Config\Definition\ArrayNode $node )

Validate the configuration of a concrete node.

Validate the configuration of a concrete node.

Parameters

$node
Symfony\Component\Config\Definition\ArrayNode
$node The related node

Throws

Symfony\Component\Config\Definition\Exception\InvalidDefinitionException
protected
# validatePrototypeNode( Symfony\Component\Config\Definition\PrototypedArrayNode $node )

Validate the configuration of a prototype node.

Validate the configuration of a prototype node.

Parameters

$node
Symfony\Component\Config\Definition\PrototypedArrayNode
$node The related node

Throws

Symfony\Component\Config\Definition\Exception\InvalidDefinitionException
Methods inherited from Symfony\Component\Config\Definition\Builder\NodeDefinition
attribute(), beforeNormalization(), cannotBeEmpty(), cannotBeOverwritten(), defaultFalse(), defaultNull(), defaultTrue(), defaultValue(), end(), example(), getNode(), info(), isRequired(), merge(), normalization(), setParent(), treatFalseLike(), treatNullLike(), treatTrueLike(), validate(), validation()
Properties summary
protected mixed $performDeepMerging
#
protected mixed $ignoreExtraKeys
#
protected mixed $children
#
protected mixed $prototype
#
protected mixed $atLeastOne
#
protected mixed $allowNewKeys
#
protected mixed $key
#
protected mixed $removeKeyItem
#
protected mixed $addDefaults
#
protected mixed $addDefaultChildren
#
protected mixed $nodeBuilder
#
protected mixed $normalizeKeys
#
Properties inherited from Symfony\Component\Config\Definition\Builder\NodeDefinition
$allowEmptyValue, $attributes, $default, $defaultValue, $falseEquivalent, $merge, $name, $normalization, $nullEquivalent, $parent, $required, $trueEquivalent, $validation
php-coveralls API documentation generated by ApiGen 2.8.0