Normalize Given Name

- the name can't contains separate(/) string
- cant contains any space
- names stored as all lowercase

@param string $name

@return string
325029
protected function _normalizeName($name)
    {
        if (!is_string($name) || $name === '' )
            throw new \Exception(sprintf(
                'Name must be a none empty string, you injected (%s).'
                , \Poirot\Std\flatten($name)
            ));

        if (isset($this->_c_normalizedNames[$name]))
            return $this->_c_normalizedNames[$name];

        $canonicalName = strtolower(
            // TODO better normalize function replace none digit and words with '' except \\ as separator
            strtr($name, array('-'=>'', '.'=>'', '=>', '\\'=>self::SEPARATOR))
        );

        if (strstr($name, self::SEPARATOR) !== false)
            throw new \Exception(sprintf(
                'Service Or Alias Name Cant Contains Separation String (%s).'
                , self::SEPARATOR
            ));

        return $this->_c_normalizedNames[$name] = $canonicalName;
    }
878991
public function parse($name): Name
    {
        $name = $this->normalize($name);

        $segments = explode(',', $name);

        if (1 < count($segments)) {
            return $this->parseSplitName($segments[0], $segments[1], $segments[2] ?? '');
        }

        $parts = explode(' ', $name);

        foreach ($this->getMappers() as $mapper) {
            $parts = $mapper->map($parts);
        }

        return new Name($parts);
    }
151737
public static function normalize($name)
	{
		if (!static::isValid($name))
		{
			throw new InvalidArgumentException("Invalid tag name '" . $name . "'");
		}

		// Non-namespaced tags are uppercased
		if (strpos($name, ':') === false)
		{
			$name = strtoupper($name);
		}

		return $name;
	}
16364
private function quoteAliasedName(string $name): string
    {
        $parts = preg_split('/ AS /i', $name);
        foreach ($parts as $i => $part) {
            $parts[$i] = $this->quoteSimpleName($part);
        }
        return implode(' AS ', $parts);
    }
389149
protected function getNamedParameterRegex($name)
    {
        if (mb_substr($name, 0, 1) == ':') {
            $name = mb_substr($name, 1);
        }

        return $this->wrapRegex($this->notInsideQuotes('\:' . preg_quote($name), false));
    }
855078
protected function normalizeName($name)
	{
		$delimiter = ViewFinderInterface::HINT_PATH_DELIMITER;

		if (strpos($name, $delimiter) === false)
		{
			return str_replace('/', '.', $name);
		}

		list($namespace, $name) = explode($delimiter, $name);

		return $namespace . $delimiter . str_replace('/', '.', $name);
	}
361431
private function sanitizeHeaderName($name)
    {
        $name = str_replace('-', ' ', $name);
        $name = ucwords($name);
        return str_replace(' ', '-', $name);
    }
242910
private function filterConstant($name) {
        $name = str_replace(' ', '_', $name);
        $name = preg_replace_callback(
            '@[A-Z][a-z]@',
            function ($matches) {
                return '_' . $matches[0];
            },
            $name
        );


        $name = str_replace(
            array(
                '/',
                '-',
                ',',
                '|',
                "\t"
            ),
            array(
                '_SLASH_',
                '_DASH_',
                '_COMMA_',
                '_PIPE_',
                '_TAB_'
            ),
            $name
        );
        $name = trim($name, '_');
        $name = preg_replace('@_+@', '_', $name);
        $name = preg_replace('@[^a-zA-Z0-9_]@', '', $name); //Strip out bad characters
        $name = strtoupper($name);
        if(is_numeric($name)) {
            $name = 'VALUE_'.$name;
        }
        return $name;
    }
852927
public static function get( $name = '' ) {
		$name = self::sanitize( $name );
		$filename = self::get_filename( $name );

		return $filename ? @file_get_contents( $filename ) : '';
	}
918657
public static function normalize($name)
	{
		$name = (string) $name;

		if (!static::isValid($name))
		{
			throw new InvalidArgumentException("Invalid parameter name '" . $name . "'");
		}

		return $name;
	}
996339
protected function getNormalizedName(string $name): string
    {
        $name = str_replace('antaresproject/component-', 'antares/', $name);
        $name = str_replace('antaresproject/module-', 'antares/', $name);

        return str_replace('-', '_', $name);
    }
1044703
def normalize(cls, name):
        """"""
        name = name.lower() # lower-case
        for _replace in [' ','-','(',')','?']:
            name = name.replace(_replace,'')
        return name
1073228
protected function normalizeName($name)
    {
        $name = strtr(strtolower($name), '_', '-');

        if (strpos($name, 'http-') === 0) {
            $name = substr($name, 5);
        }

        return $name;
    }
808018
protected function normalizeName($name)
    {
        $path = $this->finder->find($name);

        if ($path && in_array($path, $this->paths[static::MAIN_NAMESPACE])) {
            $this->prependPath($path);
        }

        return parent::normalizeName($name);
    }
1113192
def normalize_name(name):
    
    if not name or not isinstance(name, basestring):
        raise ValueError('Can only normalize non-empty string names. Unexpected '+ repr(name))

    if len(name) > 1:
        name = name.lower()
    if name != '_' and '_' in name:
        name = name.replace('_', ' ')

    return canonical_names.get(name, name)
957881
public static function normalizeSvgAttribute($name) {
        $name = strtolower($name);
        if (isset(static::$svgCaseSensitiveAttributeMap[$name])) {
            $name = static::$svgCaseSensitiveAttributeMap[$name];
        }

        return $name;
    }
118969
private static function validateName(string $name) : string
  {
    if (empty($name) || preg_match("/[=,; \t\r\n\013\014]/", $name)) {
      throw new \InvalidArgumentException(sprintf('Invalid name \'%s\'.', $name));
    }

    return $name;
  }