/** * {@inheritdoc} */ public function __construct($name, array $config = []) { parent::__construct($name, $config); $this->validators[] = function ($value) { return in_array($value, $this->options, true) ? true : "{$value} is not one of: " . implode(', ', $this->options); }; }