protected function aggregateBranchDetails($groupLines, $remoteDetails)
    {
        $configuredRefs = [];
        arsort($groupLines);
        foreach ($groupLines as $type => $lineno) {
            $configuredRefs[$type] = array_splice($remoteDetails, $lineno);
            array_shift($configuredRefs[$type]);
        }

        $configuredRefs['remoteBranches'] = isset($configuredRefs['remoteBranches'])
            ? $this->parseRemoteBranches($configuredRefs['remoteBranches'])
            : [];

        $configuredRefs['localBranches'] = isset($configuredRefs['localBranches'])
            ? $this->parseLocalPullBranches($configuredRefs['localBranches'])
            : [];

        $configuredRefs['localRefs'] = isset($configuredRefs['localRefs'])
            ? $this->parseLocalPushRefs($configuredRefs['localRefs'])
            : [];

        $aggBranches = [];
        foreach ($configuredRefs as $branches) {
            foreach ($branches as $branchName => $data) {
                if (!isset($aggBranches[$branchName])) {
                    $aggBranches[$branchName] = [];
                }
                $aggBranches[$branchName] = $aggBranches[$branchName] + $data;
            }
        }

        return $aggBranches;
    }
protected function aggregateBranchDetails($groupLines, $remoteDetails)
    {
        $configuredRefs = [];
        arsort($groupLines);
        foreach ($groupLines as $type => $lineno) {
            $configuredRefs[$type] = array_splice($remoteDetails, $lineno);
            array_shift($configuredRefs[$type]);
        }

        $configuredRefs['remoteBranches'] = isset($configuredRefs['remoteBranches'])
            ? $this->parseRemoteBranches($configuredRefs['remoteBranches'])
            : [];

        $configuredRefs['localBranches'] = isset($configuredRefs['localBranches'])
            ? $this->parseLocalPullBranches($configuredRefs['localBranches'])
            : [];

        $configuredRefs['localRefs'] = isset($configuredRefs['localRefs'])
            ? $this->parseLocalPushRefs($configuredRefs['localRefs'])
            : [];

        $aggBranches = [];
        foreach ($configuredRefs as $branches) {
            foreach ($branches as $branchName => $data) {
                if (!isset($aggBranches[$branchName])) {
                    $aggBranches[$branchName] = [];
                }
                $aggBranches[$branchName] = $aggBranches[$branchName] + $data;
            }
        }

        return $aggBranches;
    }
protected function aggregateBranchDetails ( $ groupLines , $ remoteDetails ) { $ configuredRefs = [ ] ; arsort ( $ groupLines ) ; foreach ( $ groupLines as $ type => $ lineno ) { $ configuredRefs [ $ type ] = array_splice ( $ remoteDetails , $ lineno ) ; array_shift ( $ configuredRefs [ $ type ] ) ; } $ configuredRefs [ 'remoteBranches' ] = isset ( $ configuredRefs [ 'remoteBranches' ] ) ? $ this -> parseRemoteBranches ( $ configuredRefs [ 'remoteBranches' ] ) : [ ] ; $ configuredRefs [ 'localBranches' ] = isset ( $ configuredRefs [ 'localBranches' ] ) ? $ this -> parseLocalPullBranches ( $ configuredRefs [ 'localBranches' ] ) : [ ] ; $ configuredRefs [ 'localRefs' ] = isset ( $ configuredRefs [ 'localRefs' ] ) ? $ this -> parseLocalPushRefs ( $ configuredRefs [ 'localRefs' ] ) : [ ] ; $ aggBranches = [ ] ; foreach ( $ configuredRefs as $ branches ) { foreach ( $ branches as $ branchName => $ data ) { if ( ! isset ( $ aggBranches [ $ branchName ] ) ) { $ aggBranches [ $ branchName ] = [ ] ; } $ aggBranches [ $ branchName ] = $ aggBranches [ $ branchName ] + $ data ; } } return $ aggBranches ; }
provided with the start points of the branch details, parse out the
branch details and return a structured representation of said details

@param array $groupLines    Associative array whose values are line numbers
are respective of the "group" detail present in $remoteDetails
@param array $remoteDetails Output of git-remote show [name]

@return array
provided with the start points of the branch details parse out the branch details and return a structured representation of said details