* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Config\Definition\Builder; use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException; /** * Abstract class that contains common code of integer and float node definitions. * * @author David Jeanmonod */ abstract class NumericNodeDefinition extends ScalarNodeDefinition { protected $min; protected $max; /** * Ensures that the value is smaller than the given reference. * * @param mixed $max * * @return $this * * @throws \InvalidArgumentException when the constraint is inconsistent */ public function max($max) { if (isset($this->min) && $this->min > $max) { throw new \InvalidArgumentException(sprintf('You cannot define a max(%s) as you already have a min(%s)', $max, $this->min)); } $this->max = $max; return $this; } /** * Ensures that the value is bigger than the given reference. * * @param mixed $min * * @return $this * * @throws \InvalidArgumentException when the constraint is inconsistent */ public function min($min) { if (isset($this->max) && $this->max < $min) { throw new \InvalidArgumentException(sprintf('You cannot define a min(%s) as you already have a max(%s)', $min, $this->max)); } $this->min = $min; return $this; } /** * {@inheritdoc} * * @throws InvalidDefinitionException */ public function cannotBeEmpty() { throw new InvalidDefinitionException('->cannotBeEmpty() is not applicable to NumericNodeDefinition.'); } } __halt_compiler();----SIGNATURE:----Tn6nX83DJiQLQFeZwaEFYY2vapU/6RSfkSq7PvcWgQHjYKMo/F1vLPAFq0SwFVHXOgWY5PmSst8LzuVeJn7L5sA+FKO0+n3kFZLQeSAwT5HktxZZAL68sZYjMZssLXPjCFQU+PsoYeEJ6JtywHNHaaxd1AgGT4u5fo5ASt1odtc6f0O+567SEkejDqxD8VZdIYaWQ3+ih/eG/Dpe6sUc7Iz+/+YoBuBsWloXSJ8+w3DK1LyFywAzMB/tCMGGPbv0sC8ZlCpkaIAUPbq10aMW2C3+2TrZrxAQjKKvLSRMzdxfTWdCn6z7VL5Ewgx9uac5H5Gv0eIHGipwk3MfZ1bs5ul9Wg5sWe6MNn64Aemg/YMpsQDMdeoOonO9ud9Mc4Ko31P5lzErFl5dQ26JA44oy1u34q+967ug0kXN3+Pm2QxTmxslE3iCJ+qeDLDbNc8SxfOAtD/1OXcIIvcngIj/e71ceYWYz8S412TDftHUYhhBGyfBJN5Sh9HTwIOnh9DSO+U//ZRl7XPUHmzjDmgxJN0yqNnwqHeoxPqU6ACznSEkiGUcclwLRCjX41+dfTeCLDrMq6BV9Mep7uIuGM3lAi6UokIoeQXR8UUbgwrk582n9yQRt79/dCVRoVCfPUuxXd/H07pFK9xgOiVMxhmy/oL64FoaSxIPAoDgS55ekp4=----ATTACHMENT:----NzU5NjQ1MDIyMTEyNDkwMyA2MjMwNzM5MDExNjY0NjYxIDQwNTIxODgzMzU1OTUzMDg=