Tomas Votruba c81e0916bc Updated Rector to commit 9f311dca009b4bd6ef7fbc3e57500197db41e50a
9f311dca00 Add failing test fixture for RemoveParentCallWithoutParentRector (#711)
2021-08-19 04:03:26 +00:00

43 lines
1.3 KiB
PHP

<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace RectorPrefix20210819\Symfony\Component\Config\Definition;
use RectorPrefix20210819\Symfony\Component\Config\Definition\Exception\InvalidTypeException;
/**
* This node represents an integer value in the config tree.
*
* @author Jeanmonod David <david.jeanmonod@gmail.com>
*/
class IntegerNode extends \RectorPrefix20210819\Symfony\Component\Config\Definition\NumericNode
{
/**
* {@inheritdoc}
*/
protected function validateType($value)
{
if (!\is_int($value)) {
$ex = new \RectorPrefix20210819\Symfony\Component\Config\Definition\Exception\InvalidTypeException(\sprintf('Invalid type for path "%s". Expected "int", but got "%s".', $this->getPath(), \get_debug_type($value)));
if ($hint = $this->getInfo()) {
$ex->addHint($hint);
}
$ex->setPath($this->getPath());
throw $ex;
}
}
/**
* {@inheritdoc}
*/
protected function getValidPlaceholderTypes() : array
{
return ['int'];
}
}