Validates the fieldSetting name.

@param string $name

@return \eZ\Publish\SPI\FieldType\ValidationError|null
166433
private function validateSettingName($name)
    {
        if (!isset($this->settingsSchema[$name])) {
            return new ValidationError(
                "Setting '%setting%' is unknown",
                null,
                [
                    '%setting%' => $name,
                ],
                "[$name]"
            );
        }

        return null;
    }
1093881
public function validatePropertyName($name)
    {
        $name = trim($name);

        // If the property name is invalid
        if (!strlen($name) || !preg_match('/^[a-zA-Z][a-zA-Z0-9]*$/', $name)) {
            throw new RuntimeException(
                sprintf(RuntimeException::INVALID_PROPERTY_NAME_STR, $name),
                RuntimeException::INVALID_PROPERTY_NAME
            );
        }

        return $name;
    }
1222607
public function getConfigurator(string $name): FieldSetConfigurator
    {
        if (!isset($this->configurators[$name])) {
            if (isset($this->serviceIds[$name])) {
                $configurator = $this->container->get($this->serviceIds[$name]);
            } elseif (class_exists($name)) {
                // Support fully-qualified class names.
                $configurator = new $name();
            } else {
                throw new InvalidArgumentException(sprintf('Could not load FieldSet configurator "%s".', $name));
            }

            if (!$configurator instanceof FieldSetConfigurator) {
                throw new InvalidArgumentException(sprintf('Configurator class "%s" is expected to be an instance of '.FieldSetConfigurator::class, $name));
            }

            $this->configurators[$name] = $configurator;
        }

        return $this->configurators[$name];
    }
748307
public function getValidator($name = '')
    {
        if ($this->dirty || !isset($this->validator[$name]) || $this->validator[$name] == null) {
            $this->validator[$name] = $this->buildValidator($this->validators, $name);
            $this->dirty = false;
        }

        return $this->validator[$name];
    }
21039
private function validateKeyName($name)
    {
        if (! is_string($name)) {
            throw InvalidArgumentException::invalidType('key', 'string', $name);
        }

        $len = strlen($name);
        if ($len > 255 || $len < 1) {
            throw InvalidArgumentException::invalidLength('name', 1, 255);
        }
    }
1080149
public static function validateClass($name, $namespace = null)
    {
        $name = self::validateNamingConvention($name);

        $prefix = !empty($namespace) ? $namespace . '\\' : '';

        $name = self::validateUnique($name, function ($name) use ($prefix) {
                // Use reflection to get access to private isKeyword method.
                // @todo Remove this when we stop supporting PHP 5.3.
                $isKeywordMethod = new \ReflectionMethod(__CLASS__, 'isKeyword');
                $isKeywordMethod->setAccessible(true);
                $isKeyword = $isKeywordMethod->invoke(null, $name);
             return !$isKeyword &&
                !interface_exists($prefix . $name) &&
                !class_exists($prefix . $name);
        }, self::NAME_SUFFIX);

        return $name;
    }
1097291
protected static function validateHeaderName(string $name){
        static $validCache = [];

        if(!isset($validCache[$name])){
            if(1 !== preg_match(static::REGEX_HEADER_NAME, $name)){
                throw new \InvalidArgumentException(
                    "Invalid Header name given."
                );
            }
        }

        $validCache[$name]  = true;
    }
723370
public function getConfig($name) {
        return isset($this->settings[$name]) ? $this->settings[$name] : null;
    }
1115718
public function setName($name)
    {
        $this->valueField->setName($name);

        parent::setName($name);

        return $this;
    }
279954
public function getField($name)
		{
			return isset($this->fields[$name])
				? $this->fields[$name]
				: null;
		}
1031458
private function validateName($name)
    {
        if (strlen($name) < 1) {
            throw new \InvalidArgumentException('The name cannot be empty');
        }

        // Name attribute is a token as per spec in RFC 2616
        if (preg_match('/[\x00-\x20\x22\x28-\x29\x2C\x2F\x3A-\x40\x5B-\x5D\x7B\x7D\x7F]/', $name)) {
            throw new \InvalidArgumentException(sprintf('The cookie name "%s" contains invalid characters.', $name));
        }
    }
622660
protected function assertValidName($name)
    {
        if (!is_string($name) && $name !== null) {
            $actualType = is_object($name) ? get_class($name) : gettype($name);
            $message = $this->translator()->translate(
                '{{ parameter }} must be a {{ expectedType }}, received {{ actualType }}',
                [
                    '{{ parameter }}'    => '"name"',
                    '{{ expectedType }}' => 'string',
                    '{{ actualType }}'   => $actualType,
                ]
            );

            throw new InvalidArgumentException($message, 400);
        }
    }
908964
public function validateName($name)
    {
        if (empty($name)) {
            $this->addError('name', 'Name cannot be empty');
            return false;
        }

        if (!is_string($name)) {
            $this->addError('name', 'Name must be a string');
            return false;
        }

        if (mb_strlen($name, 'UTF-8') > 255) {
            $this->addError('name', 'Name length has to be less or equal to 255');
            return false;
        }


        return true;
    }
205828
public function hasValidator(string $name): bool
    {
        $rules = $this->getRules();

        return \method_exists($this, 'validate' . \ucfirst($name)) || isset($rules[$name]);
    }
283189
protected function validate($name, $value, $validators = null)
    {
        if (empty($validators)) {
            $validators = @$this->fieldValidators[$name];
        }
        $failedValidations = array();

        if (!empty($validators)) {
            foreach ($validators as $type) {
                Logger::get()->debug("Validating $name with $type...");
                $validator = Validators::get($type);
                if (!$validator->isValid($value)) {
                    Logger::get()->debug('Failed!');
                    // The validation has failed, report its data.
                    $failedValidations[] = $validator->getFailMessage();
                }
            }
        }

        return $failedValidations;
    }
428855
public function setName($name)
    {
        $this->name = $name;
        $this->setChecked($this->form->getFieldValue($this->name) == $this->getValue());
        return $this;
    }
1201142
public function find($name)
    {
        if (Str::contains($name, '.')) {
            list($fieldset, $control) = explode('.', $name, 2);
        } else {
            $fieldset = 'fieldset-0';
            $control  = $name;
        }

        if (!array_key_exists($fieldset, $this->keyMap)) {
            throw new InvalidArgumentException("Name [{$name}] is not available.");
        }

        return $this->keyMap[$fieldset]->of($control);
    }