namespace Symfony\Component\Config\Definition\Builder;
use Symfony\Component\Config\Definition\ArrayNode;
-use Symfony\Component\Config\Definition\PrototypedArrayNode;
use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException;
+use Symfony\Component\Config\Definition\PrototypedArrayNode;
/**
* This class provides a fluent interface for defining an array node.
$path = $node->getPath();
if (null !== $this->key) {
- throw new InvalidDefinitionException(
- sprintf('->useAttributeAsKey() is not applicable to concrete nodes at path "%s"', $path)
- );
+ throw new InvalidDefinitionException(sprintf('->useAttributeAsKey() is not applicable to concrete nodes at path "%s"', $path));
}
if (false === $this->allowEmptyValue) {
}
if (true === $this->atLeastOne) {
- throw new InvalidDefinitionException(
- sprintf('->requiresAtLeastOneElement() is not applicable to concrete nodes at path "%s"', $path)
- );
+ throw new InvalidDefinitionException(sprintf('->requiresAtLeastOneElement() is not applicable to concrete nodes at path "%s"', $path));
}
if ($this->default) {
- throw new InvalidDefinitionException(
- sprintf('->defaultValue() is not applicable to concrete nodes at path "%s"', $path)
- );
+ throw new InvalidDefinitionException(sprintf('->defaultValue() is not applicable to concrete nodes at path "%s"', $path));
}
if (false !== $this->addDefaultChildren) {
- throw new InvalidDefinitionException(
- sprintf('->addDefaultChildrenIfNoneSet() is not applicable to concrete nodes at path "%s"', $path)
- );
+ throw new InvalidDefinitionException(sprintf('->addDefaultChildrenIfNoneSet() is not applicable to concrete nodes at path "%s"', $path));
}
}
$path = $node->getPath();
if ($this->addDefaults) {
- throw new InvalidDefinitionException(
- sprintf('->addDefaultsIfNotSet() is not applicable to prototype nodes at path "%s"', $path)
- );
+ throw new InvalidDefinitionException(sprintf('->addDefaultsIfNotSet() is not applicable to prototype nodes at path "%s"', $path));
}
if (false !== $this->addDefaultChildren) {
if ($this->default) {
- throw new InvalidDefinitionException(
- sprintf('A default value and default children might not be used together at path "%s"', $path)
- );
+ throw new InvalidDefinitionException(sprintf('A default value and default children might not be used together at path "%s"', $path));
}
- if (null !== $this->key && (null === $this->addDefaultChildren || is_int($this->addDefaultChildren) && $this->addDefaultChildren > 0)) {
- throw new InvalidDefinitionException(
- sprintf('->addDefaultChildrenIfNoneSet() should set default children names as ->useAttributeAsKey() is used at path "%s"', $path)
- );
+ if (null !== $this->key && (null === $this->addDefaultChildren || \is_int($this->addDefaultChildren) && $this->addDefaultChildren > 0)) {
+ throw new InvalidDefinitionException(sprintf('->addDefaultChildrenIfNoneSet() should set default children names as ->useAttributeAsKey() is used at path "%s"', $path));
}
- if (null === $this->key && (is_string($this->addDefaultChildren) || is_array($this->addDefaultChildren))) {
- throw new InvalidDefinitionException(
- sprintf('->addDefaultChildrenIfNoneSet() might not set default children names as ->useAttributeAsKey() is not used at path "%s"', $path)
- );
+ if (null === $this->key && (\is_string($this->addDefaultChildren) || \is_array($this->addDefaultChildren))) {
+ throw new InvalidDefinitionException(sprintf('->addDefaultChildrenIfNoneSet() might not set default children names as ->useAttributeAsKey() is not used at path "%s"', $path));
}
}
}