AliasCollection.php
protected function removeDependedAliases($alias, $id)
    {
        foreach ($this->ids[$id] as $otherAlias) {
            if (isset($this->aliases[$otherAlias]) && $this->aliases[$otherAlias] === $alias) {
                unset($this->aliases[$otherAlias]);
                $aliases = &$this->ids[$id];
                unset($aliases[array_search($otherAlias, $aliases, true)]);
                if (!empty($aliases)) {
                    $this->removeDependedAliases($otherAlias, $id);
                } else {
                    unset($this->ids[$id]);
                }
            }
        }
    }
protected function removeDependedAliases($alias, $id)
    {
        foreach ($this->ids[$id] as $otherAlias) {
            if (isset($this->aliases[$otherAlias]) && $this->aliases[$otherAlias] === $alias) {
                unset($this->aliases[$otherAlias]);
                $aliases = &$this->ids[$id];
                unset($aliases[array_search($otherAlias, $aliases, true)]);
                if (!empty($aliases)) {
                    $this->removeDependedAliases($otherAlias, $id);
                } else {
                    unset($this->ids[$id]);
                }
            }
        }
    }
protected function removeDependedAliases ( $ alias , $ id ) { foreach ( $ this -> ids [ $ id ] as $ otherAlias ) { if ( isset ( $ this -> aliases [ $ otherAlias ] ) && $ this -> aliases [ $ otherAlias ] === $ alias ) { unset ( $ this -> aliases [ $ otherAlias ] ) ; $ aliases = & $ this -> ids [ $ id ] ; unset ( $ aliases [ array_search ( $ otherAlias , $ aliases , true ) ] ) ; if ( ! empty ( $ aliases ) ) { $ this -> removeDependedAliases ( $ otherAlias , $ id ) ; } else { unset ( $ this -> ids [ $ id ] ) ; } } } }
Removes all depended aliases
For example if "alias3" is removed in alias chain like "alias1 -> alias2 -> alias3 -> id"
than both "alias1" and "alias2" are removed as well

@param string $alias
@param string $id
Removes all depended aliases For example if alias3 is removed in alias chain like alias1 - > alias2 - > alias3 - > id than both alias1 and alias2 are removed as well