protected function getExistingAliases($currentGroup, $previousGroup = null)
    {
        $aliases = [];
        foreach (array_filter([$currentGroup, $previousGroup]) as $groupName) {
            foreach ($this->drush->getAliases($groupName) as $name => $alias) {
                // Remove the group prefix from the alias name.
                $name = ltrim($name, '@');
                if (strpos($name, $groupName . '.') === 0) {
                    $name = substr($name, strlen($groupName . '.'));
                }

                $aliases[$name] = $alias;
            }
        }

        return $aliases;
    }
protected function getExistingAliases($currentGroup, $previousGroup = null)
    {
        $aliases = [];
        foreach (array_filter([$currentGroup, $previousGroup]) as $groupName) {
            foreach ($this->drush->getAliases($groupName) as $name => $alias) {
                // Remove the group prefix from the alias name.
                $name = ltrim($name, '@');
                if (strpos($name, $groupName . '.') === 0) {
                    $name = substr($name, strlen($groupName . '.'));
                }

                $aliases[$name] = $alias;
            }
        }

        return $aliases;
    }
protected function getExistingAliases ( $ currentGroup , $ previousGroup = null ) { $ aliases = [ ] ; foreach ( array_filter ( [ $ currentGroup , $ previousGroup ] ) as $ groupName ) { foreach ( $ this -> drush -> getAliases ( $ groupName ) as $ name => $ alias ) { // Remove the group prefix from the alias name. $ name = ltrim ( $ name , '@' ) ; if ( strpos ( $ name , $ groupName . '.' ) === 0 ) { $ name = substr ( $ name , strlen ( $ groupName . '.' ) ) ; } $ aliases [ $ name ] = $ alias ; } } return $ aliases ; }
Find the existing defined aliases so they can be merged with new ones.

@param string      $currentGroup
@param string|null $previousGroup

@return array
The aliases, with their group prefixes removed.
Find the existing defined aliases so they can be merged with new ones .