4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Config\Definition\Builder;
14 use Symfony\Component\Config\Definition\BooleanNode;
15 use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException;
18 * This class provides a fluent interface for defining a node.
20 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
22 class BooleanNodeDefinition extends ScalarNodeDefinition
27 public function __construct($name, NodeParentInterface $parent = null)
29 parent::__construct($name, $parent);
31 $this->nullEquivalent = true;
37 * @return BooleanNode The node
39 protected function instantiateNode()
41 return new BooleanNode($this->name, $this->parent);
47 * @throws InvalidDefinitionException
49 public function cannotBeEmpty()
51 throw new InvalidDefinitionException('->cannotBeEmpty() is not applicable to BooleanNodeDefinition.');