prepareConatinerName

@param string $name

@return string
502496
protected function prepareContainerName($name = '')
    {
        $name = (string)$name;

        if (empty($name)) {
            return $this->defaultContainerName;
        }

        return $name;
    }
1055754
public static function niceTitle($name)
    {
        if (empty($name)) {
            return '';
        }

        $gateway = null;

        try {
            $factory = new GatewayFactory();
            $gateway = $factory->create($name);
        } catch (\Exception $e) {
            /** do nothing */
        }

        $title = _t(
            'Gateway.' . $name,
            $gateway ? $gateway->getName() : $name
        );

        return ($title) ? $title : $gateway->getName();
    }
550548
public function getNameSpace(string $name) : string
    {
        $segs = [];
        $name = str_replace("/", "\\", $name);
        $namespace = explode("\\", $name);
        array_pop($namespace);

        array_walk($namespace, function (&$value) {
            $value = $this->removeNoneAlpherNumeric($value);
        });

        return implode("\\", $namespace);
    }
970217
public function transformNameForID($name)
    {
        $bits = explode('.', $name);
        array_walk(
            $bits,
            function (&$value, $key) {
                $value = ucfirst(strtolower($value));
            }
        );
        return implode('', $bits);
    }
93281
private function generateContentAlias($name)
    {
        $alias = $name;
        while ($this->hasContent($alias)) {
            $alias = uniqid($name . '_');
        }

        return $alias;
    }
874424
public function name($name) {
		if (isset($this->_cachedNames[$name])) {
			return $this->_cachedNames[$name];
		}

		list($open, $close) = $this->_quotes;
		list($first, $second) = $this->_splitFieldname($name);

		if ($first) {
			$result = "{$open}{$first}{$close}.{$open}{$second}{$close}";
		} elseif (preg_match('/^[a-z0-9_-]+$/iS', $name)) {
			$result = "{$open}{$name}{$close}";
		} else {
			$result = $name;
		}
		return $this->_cachedNames[$name] = $result;
	}
1307926
public function withoutHeader($name)
    {
        $message = clone $this;
        $headers = $message->headers();
        unset($headers[$name]);
        return $message;
    }
1227585
protected function normalizeHeaderName($name)
    {
        $name = str_replace('-', '_', strtoupper($name));
        if (!in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'])) {
            $name = 'HTTP_' . $name;
        }

        return $name;
    }
1347665
public static function clean_page_url($name)
    {
        $name = str_replace(array(' '), '_', $name);

        $name = self::trim_extension_off($name);
        $name = self::trim_sort_number($name);

        if (preg_match('/^[\/]?index[\/]?/', $name)) {
            return '';
        }

        return strtolower($name);
    }
680869
public static function parseName($name)
    {
        $name = urldecode($name);
        $names = explode(' ', str_replace(',', '', $name));

        $pretitle = $first_name = $last_name = $posttitle = '';

        foreach ($names as $name) {
            if (('.' === mb_substr($name, -1) || 'et' === $name) && empty($first_name)) {
                $pretitle .= $name.' ';
                continue;
            }
            if (empty($first_name)) {
                $first_name = $name;
                continue;
            }
            if ('.' === mb_substr($name, -1) && !empty($last_name)) {
                $posttitle .= $name.' ';
                continue;
            }
            if (!empty($first_name)) {
                $last_name .= $name.' ';
                continue;
            }
        }

        return [
            trim($pretitle),
            mb_convert_case(trim(mb_strtolower($first_name)), MB_CASE_TITLE, 'UTF-8'),
            mb_convert_case(trim(mb_strtolower($last_name)), MB_CASE_TITLE, 'UTF-8'),
            trim($posttitle),
        ];
    }
1104908
public static function fqcn(string $name): string
    {
        $type = str_replace('[]', '', $name);

        if (class_exists($type) || interface_exists($type) && '\\' !== $type[0]) {
            return '\\' . $name;
        }

        return $name;
    }
1126095
public static function formatName($name)
    {
        /* Split name and version */
        $parts = [];
        if (preg_match('/([^[0-9]*)([0-9]*)/', $name, $parts) === false) {
            return $name;
        }

        /* Format name */
        $base = $parts[1];
        switch ($base) {
            case 'MySql':
                $base = 'MySQL';
                break;
            case 'MariaDb':
                $base = 'MariaDB';
                break;
        }

        /* Parse version to array */
        $ver_str = $parts[2];
        if (strlen($ver_str) % 2 === 1) {
            $ver_str = '0' . $ver_str;
        }
        $version = array_map('intval', str_split($ver_str, 2));
        /* Remove trailing zero */
        if ($version[count($version) - 1] === 0) {
            $version = array_slice($version, 0, count($version) - 1);
        }
        /* Create name */
        return $base . ' ' . implode('.', $version);
    }
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;
    }
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));
    }
361431
private function sanitizeHeaderName($name)
    {
        $name = str_replace('-', ' ', $name);
        $name = ucwords($name);
        return str_replace(' ', '-', $name);
    }
1245320
protected function prepareIndexName( array $columns, &$name )
    {
        $cols = implode( ', ', $columns );
        $cols = rtrim( $cols, ', ' );

        if ( '' === $name )
        {
            $name = 'index_' . str_replace( ', ', '_', $cols );
        }

        return $cols;
    }
1155589
private function parseReferences($name): string
    {
        if (preg_match_all('/\$\{(.*[a-z\.0-9])\}/si', $name, $results, PREG_SET_ORDER)) {
            foreach ($results as $match) {
                $replace = $match[0];
                $key = $match[1];

                // Handle using relative placement like get('db.${.default}.host');
                if (strpos($key, '.') === 0) {
                    // using relative placement
                    $key = substr($name, 0, strpos($name, $replace) - 1) . $key;
                }

                // get the value
                $value = $this->get($key);
                if ($value === null || $value === '' || $value === false) {
                    throw new InvalidArgumentException(
                        $key . ' replacement for ' . $name . ' must not be null or empty'
                    );
                }

                $name = str_replace($replace, $value, $name);
            }
        }

        return $name;
    }