public function __construct($isRequired = false) { $this->spec = $this->getDefaultSpec(); $this->required = (bool) $isRequired; if ($isRequired) { $this->spec['mustHaveValue'] = true; } }