label = $this->getValidatedType($label); } /** * @return string * @since 13.0.0 */ public function getLabel() { return $this->label; } /** * @param $type * @return string * @throws \InvalidArgumentException * @since 13.0.0 */ protected function getValidatedType($type) { $type = trim((string)$type); if ($type === '') { throw new \InvalidArgumentException('Type must not be empty'); } if ($type === 'exact') { throw new \InvalidArgumentException('Provided type is a reserved word'); } return $type; } }