protected function sortAvailablePackagesByDependencies(array $packageStates)
    {
        $packageOrderResolver = new PackageOrderResolver($packageStates['packages'], $this->collectPackageManifestData($packageStates));
        $packageStates['packages'] = $packageOrderResolver->sort();

        return $packageStates;
    }
protected function sortAvailablePackagesByDependencies(array $packageStates)
    {
        $packageOrderResolver = new PackageOrderResolver($packageStates['packages'], $this->collectPackageManifestData($packageStates));
        $packageStates['packages'] = $packageOrderResolver->sort();

        return $packageStates;
    }
protected function sortAvailablePackagesByDependencies ( array $ packageStates ) { $ packageOrderResolver = new PackageOrderResolver ( $ packageStates [ 'packages' ] , $ this -> collectPackageManifestData ( $ packageStates ) ) ; $ packageStates [ 'packages' ] = $ packageOrderResolver -> sort ( ) ; return $ packageStates ; }
Orders all packages by comparing their dependencies. By this, the packages
and package configurations arrays holds all packages in the correct
initialization order.

@param array $packageStates The unordered package states
@return array ordered package states.
Orders all packages by comparing their dependencies . By this the packages and package configurations arrays holds all packages in the correct initialization order .