Validate config name

@param string $name
@return bool
496605
public static function isValidName( $name ): bool
	{
		$len = strlen($name);
		if( $len < 5 || ! preg_match('/^on[A-Z][a-zA-Z]*$/', $name) )
		{
			return false;
		}

		return $len < 256;
	}
929341
public function hasOption(string $name): bool
    {
        $this->validateName($name);

        return array_key_exists($name, $this->config);
    }
588667
public function validateItemName($name)
    {
        $valid = true;
        $message = 'Valid item name.';
        if (!is_string($name))
        {
            $valid = false;
            $message = 'Only string values are allowed for item names!';
        }

        if (in_array($name, $this->invalidItemNames))
        {
            $valid = false;
            $message = sprintf('Item name is not allowed! Not allowed item names: %s',
                               implode(', ', $this->invalidItemNames));
        }

        if (preg_match(sprintf('/[%s]/', $this->invalidCharsForItemNames), $name) > 0)
        {
            $valid = false;
            $message = sprintf('Invalid name for ini item! Provided item name contains not ' .
                               'allowed chars (%s).', $this->invalidCharsForItemNames);
        }

        return [$valid, $message];
    }
1030740
public function honeypotValidates($name)
    {
        $value = "";

        if ($this->hasPost($name)) {
            $value = $this->post($name);
        } elseif ($this->hasGet($name)) {
            $value = $this->get($name);
        }

        return empty($value);
    }
1219598
private function validateName($name) {
        if (!is_string($name))    throw new IllegalTypeException('Illegal type of parameter $name: '.gettype($name));
        if ($name != trim($name)) throw new InvalidArgumentException('Invalid parameter $name: "'.$name.'" (enclosing white space)');

        if (strlen($name) && !preg_match('/^[^\s:]+(:[^\s:]+)*$/', $name))
            throw new InvalidArgumentException('Invalid parameter $name: "'.$name.'" (not a command name)');
        return $this;
    }
1319495
public function isValid($name)
    {
        return is_string($name) && (preg_match(static::SERVICE_PATTERN, $name) || isset($this->app[$name]));
    }
54163
public function hasTag($name)
    {
        foreach ($this->tags as $tag) {
            if (strtolower($tag->getName()) == $name) {
                return true;
            }
        }
        return false;
    }
200187
private function _validate_config($name, $value)
	{
		switch ($name)
		{
			case 'cache_id':
				if (empty($value) or ! is_string($value))
				{
					$value = 'fuel';
				}
			break;

			case 'expiration':
				if (empty($value) or ! is_numeric($value))
				{
					$value = null;
				}
			break;

			default:
			break;
		}

		return $value;
	}
81908
public static function has($name)
    {
        if (!strpos($name, '.')) {
            return isset(self::$config[strtolower($name)]);
        }

        $name = explode('.', $name, 2);
        return isset(self::$config[strtolower($name[0])][$name[1]]);
    }
422702
protected function getValidatorDefine(string $name)
    {
        if (isset($this->builtinValidators[$name])) {
            return $this->builtinValidators[$name];
        }

        if (isset($this->customValidators[$name])) {
            return $this->customValidators[$name];
        }

        return false;
    }
582162
public function isSettingSet( string $name ): bool
	{
		return isset($this->settings[$name]) && !is_null($this->settings[$name]);
	}
588329
protected function validateFileName($name)
    {
        if (!preg_match('/^[\w@\.\s_\-]+$/iu', $name)) {
            return false;
        }

        if (strpos($name, '..') !== false) {
            return false;
        }

        return true;
    }
626243
public function hasExtraConfiguration($name)
    {
        $name = $this->resolveString($name, __METHOD__);

        return isset($this->extraConfiguration[$name]);
    }
245511
public function __isset($name)
    {
        if (0 === stripos($name, 'conf_')) {
            $name = str_replace('conf_', '', $name);
            if (array_key_exists($name, $this->configs)) {
                return true;
            }
        }

        return (array_key_exists($name, $this->modules) ||
            array_key_exists($name, $this->globals));
    }
714739
public function parseName($name)
    {
        if(null !== $this->config->prefix)
        {
            return str_replace('@', $this->config->prefix, $name);
        }
        else
        {
            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;
    }
915884
public function checkField($name)
    {
        return (!in_array($name, $this->fields())) ?  $this->addFields([$name=>'string']) : true;
    }