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;
14 use Symfony\Component\Config\Definition\Exception\InvalidTypeException;
17 * This node represents a Boolean value in the config tree.
19 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
21 class BooleanNode extends ScalarNode
26 protected function validateType($value)
28 if (!is_bool($value)) {
29 $ex = new InvalidTypeException(sprintf(
30 'Invalid type for path "%s". Expected boolean, but got %s.',
34 if ($hint = $this->getInfo()) {
37 $ex->setPath($this->getPath());
46 protected function isValueEmpty($value)
48 // a boolean value cannot be empty