* * 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:----WmRrcXNzM3GZEmp0Y3XNKwB+wHWD/v52OLE/GeeJwiBJYenzMqB3MfoEUbn4dHZ+gpmtCZLMqwNi3EL4Q3ShIBrPnqMRXiKBj2l50j1NDUTeTZ8tgiEuht9ux9gbgt/h9bJxrfYnMR1pe5Z9ytyF9K17E4cy05Vcw1hs6CIZIzOJCc3RkknVhwAh3ffsmRyLFJrHFGB0GnQlGMqFwgTmoVrlmK5MHVezW4KVZ+ZbR9RD4i2T4v13Jhmpj/Rw7hZ/eKlCettATtrppmgYCDMyomLIt3zOBidINxP3fAZkaENbB1dpZDKa+MaDU2cpggRd7RCvbP/6XM2vXFfuzJ96LcIL198yVM3ccxW3MQrTr/yAzTSNc8ONN4UB1hDWqTE6qLn6fFGjbU9DltZW/MkAbjpLWDKTHFAqagBKythAGUrvVcrhObTo+Eyc3eFZKLoPa9Kx6AA0/0T0oxy4ULWvOooldX4rN/dtHUFwx0SCA4jwIoJkwJ1K2tRc1jPvCr8Mz3685tvZ53Ya5OJefF7xECK0WOTepeU7SgV1IOXJYIK7pUMFb9ODAI+DPRaviV8IhVB4uEdkIcfZlTZ0/kImi4AkgIwsSz2XgfWVmoOCV6wmPj0TW4WusfQWOGH9lIDqepK6yY5LbIjjYkdiFQkCKGnWVA862jTmB1q/4ylZyew=----ATTACHMENT:----Njk4MDkyOTExNDY0MDI2NSA3NTU1OTc3NzM2MDkzMzcgODQ1MjI2NDAxNTQ0OTQ5OQ==