Parse the middleware group and format it for usage.

@param  string $name
@return array
765438
protected function parseMiddlewareGroup( $name )
	{
		$results = [];

		foreach ( $this->middlewareGroups[$name] as $middleware )
		{
			// If the middleware is another middleware group we will pull in the group and
			// merge its middleware into the results. This allows groups to conveniently
			// reference other groups without needing to repeat all their middlewares.
			if ( isset( $this->middlewareGroups[$middleware] ) )
			{
				$results = array_merge( $results, $this->parseMiddlewareGroup( $middleware ) );

				continue;
			}

			list( $middleware, $parameters ) = array_pad( explode( ':', $middleware, 2 ), 2, null );

			// If this middleware is actually a route middleware, we will extract the full
			// class name out of the middleware list now. Then we'll add the parameters
			// back onto this class' name so the pipeline will properly extract them.
			if ( isset( $this->middleware[$middleware] ) )
			{
				$middleware = $this->middleware[$middleware];
			}

			$results[] = $middleware . ( $parameters ? ':' . $parameters : '' );
		}

		return $results;
	}
580602
public function getArguments($name) {
        if (!$this->docoptResult)
            return [];

        if ($this->isArgument($name)) {
            $value = $this->docoptResult[$name];
            if (is_array($value))
                return $value;
            return [$value];
        }
        return [];
    }
583852
public function group_for_name($name)
	{
		foreach ($this->_groups as $group) 
		{
			if ($group->has($name)) 
			{
				return $group;
			}
		}
		throw new Exception("Environment variable :name does not belong to any group", array(':name' => $name));
	}
550800
public function api($name)
    {
        switch ($name) {

            case 'deploy_keys':
                return $this->deployKeys();

            case 'groups':
                return $this->groups();
                
            case 'groupsMilestones':
                return $this->groupsMilestones();

            case 'issues':
                return $this->issues();

            case 'board':
            case 'issue_boards':
                return $this->issueBoards();

            case 'group_boards':
                return $this->groupsBoards();

            case 'issue_links':
                return $this->issueLinks();

            case 'jobs':
                return $this->jobs();

            case 'mr':
            case 'merge_requests':
                return $this->mergeRequests();

            case 'milestones':
            case 'ms':
                return $this->milestones();

            case 'namespaces':
            case 'ns':
                return $this->namespaces();

            case 'projects':
                return $this->projects();

            case 'repo':
            case 'repositories':
                return $this->repositories();

            case 'repositoryFiles':
                return $this->repositoryFiles();
                
            case 'snippets':
                return $this->snippets();

            case 'hooks':
            case 'system_hooks':
                return $this->systemHooks();

            case 'users':
                return $this->users();

            case 'keys':
                return $this->keys();

            case 'tags':
                return $this->tags();

            case 'version':
                return $this->version();

            case 'environments':
                return $this->environments();

            case 'deployments':
                return $this->deployments();

            case 'schedules':
                return $this->schedules();

            default:
                throw new InvalidArgumentException('Invalid endpoint: "'.$name.'"');
        }
    }
872231
protected function parseName(string $name, string $default = self::DEFAULT_NAMESPACE): array
    {
        if ($this->hasHintInformation($name)) {
            return $this->parseNamespaceSegments($name);
        }

        return [$default, $name];
    }
525549
private function parse_name($name) {
        $bits = explode('/', $name);
        $name = array_pop($bits);
        $plugin = '';
        if ($bits) {
            $plugin = array_pop($bits);
            if ($plugin === 'moodle') {
                $plugin = '';
            }
        }
        return 's_'.$plugin.'_'.$name;
    }
272150
public function getAll($name)
    {
        $s = $this->getNormalizedHeaderName($name);
        $ret = [];
        if (!empty($this->headerMap[$s])) {
            foreach ($this->headerMap[$s] as $index) {
                $ret[] = $this->getByIndex($index);
            }
        }
        return $ret;
    }
1246876
public function getStorageServiceKeys($name)
    {
        Validate::isString($name, 'name');
        Validate::notNullOrEmpty($name, 'name');

        $context = new HttpCallContext();
        $context->setMethod(Resources::HTTP_GET);
        $context->setPath($this->_getStorageServiceKeysPath($name));
        $context->addStatusCode(Resources::STATUS_OK);

        $response = $this->sendHttpContext($context);
        $parsed = $this->dataSerializer->unserialize($response->getBody());

        return GetStorageServiceKeysResult::create($parsed);
    }
849069
protected function parseConnectionName($name)
    {
        $name = $name ?: $this->getDefaultConnection();

        return Str::endsWith($name, ['::read', '::write'])
                            ? explode('::', $name, 2) : [$name, null];
    }
292634
public static function RoutesMiddleware($name)
    {
        if (!self::existsRoutesMiddleware($name)) {
            throw new MiddlewareNotFoundException($name);
        }
        $middleware = self::allRoutesMiddleware();

        return array_get($middleware, $name);
    }
562551
public function getArrayOf(string $name) : array
    {
        return $this->nestedArrayContentGroups
            ->where(function (ContentGroup $contentArea) use ($name) {
                return $contentArea->name === $name;
            })
            ->reindex()
            ->asArray();
    }
1273360
private function getGroupByName($name)
    {
        foreach (Craft::$app->sites->getAllGroups() as $group) {
            if ($group->name === $name) {
                return $group;
            }
        }
        return null;
    }
625264
public function spartanRemote(string $name): array
    {
        $remotes = $this->spartanRemotes();

        list($user, $host, $path, $port) = preg_split('/[@\:]/', $name) + [null, null, null, 22];

        if (isset($remotes[$user])) {
            $globalRemote = $remotes[$user];
            $path         = $host;

            $user = $globalRemote['user'];
            $host = $globalRemote['host'];
            $port = (int)$globalRemote['port'];
        }

        return [
            'user' => $user,
            'host' => $host,
            'path' => $path ?: '~',
            'port' => $port,
            'auth' => "{$user}@{$host}",
        ];
    }
185826
protected function getPathFromExtensionName(string $name): array
    {
        $extension = $this->app->make('orchestra.extension');
        $finder = $this->app->make('orchestra.extension.finder');

        if ($name === 'app') {
            $basePath = $sourcePath = $this->app->basePath();
        } else {
            $basePath = $finder->resolveExtensionPath(rtrim($extension->option($name, 'path'), '/'));
            $sourcePath = $finder->resolveExtensionPath(rtrim($extension->option($name, 'source-path'), '/'));
        }

        return [$basePath, $sourcePath];
    }
702261
function FindHeaders($name) {
        $result = array();
        //if ($name[0]<>'/') $name='/^'.$name.'$/';//If regex not found convert it to an "exact phrase" regex as default
        //Return header directly if not written as regular expression (separated for speed)
        if ($name[0] <> '/') {
            if (array_key_exists($name, $_SERVER)){
                $result[$name] = $_SERVER[$name];
            }
        }else {
            //Regular expression headers search
            foreach ($_SERVER as $key => $value) {
                if (preg_match($name, $key, $match)){
                    $result[$key] = $value;
                }
            }
        }
        return $result;
    }
875079
protected function splitNameAndPath($name)
    {

        list($start, $end) = strpos($name, '::') ? explode('::', $name) : ['', $name];

        if ($start) {
            return [$start, $end];
        }

        $paths = $this->getPaths();

        // If the name does not exists in the paths, it assumes its a (file)path.
        if (!isset($paths[$end])) {
            return ['', $end];
        }

        return [$end, ''];

    }
1310700
private function getEnvArray($name): array
    {
        $env = config("api.$name", null);

        if ($env === true) {
            $env = 'true';
        }

        if ($env === false) {
            $env = 'false';
        }


        if ($env === null) {
            return [];
        }

        if ($env === '') {
            return [];
        }

        return explode(',', $env);
    }