/** * Constructor. * * @param string $name * @param NodeInterface|null $parent * @param array $values */ public function __construct($name, NodeInterface $parent = null, array $values = array()) { $values = array_unique($values); if (count($values) < 2) { throw new InvalidArgumentException('Enum values should contain at least two elements.'); } parent::__construct($name, $parent); $this->values = $values; }
/** * Constructor. * * @param string $name * @param NodeInterface|null $parent * @param int|float|double|null $min * @param int|float|double|null $max */ public function __construct($name, NodeInterface $parent = null, $min = null, $max = null) { parent::__construct($name, $parent); $this->min = $min; $this->max = $max; }