protected function orderByDependencies(array $dependencies): array
    {
        $ordered = [];
        $available = array_keys($dependencies);

        while (0 !== \count($dependencies)) {
            $success = $this->doResolve($dependencies, $ordered, $available);

            if (false === $success) {
                throw new UnresolvableDependenciesException(
                    "The dependencies order could not be resolved.\n".print_r($dependencies, true)
                );
            }
        }

        return $ordered;
    }
protected function orderByDependencies(array $dependencies): array
    {
        $ordered = [];
        $available = array_keys($dependencies);

        while (0 !== \count($dependencies)) {
            $success = $this->doResolve($dependencies, $ordered, $available);

            if (false === $success) {
                throw new UnresolvableDependenciesException(
                    "The dependencies order could not be resolved.\n".print_r($dependencies, true)
                );
            }
        }

        return $ordered;
    }
protected function orderByDependencies ( array $ dependencies ) : array { $ ordered = [ ] ; $ available = array_keys ( $ dependencies ) ; while ( 0 !== \ count ( $ dependencies ) ) { $ success = $ this -> doResolve ( $ dependencies , $ ordered , $ available ) ; if ( false === $ success ) { throw new UnresolvableDependenciesException ( "The dependencies order could not be resolved.\n" . print_r ( $ dependencies , true ) ) ; } } return $ ordered ; }
Returns a list of array keys ordered by their dependencies.

@throws UnresolvableDependenciesException

@return string[]
Returns a list of array keys ordered by their dependencies .