protected function sortAndSavePackageStates(array $packageStates)
    {
        $orderedPackageStates = $this->sortAvailablePackagesByDependencies($packageStates);
        $this->savePackageStates($orderedPackageStates);

        return $orderedPackageStates;
    }
protected function sortAndSavePackageStates(array $packageStates)
    {
        $orderedPackageStates = $this->sortAvailablePackagesByDependencies($packageStates);
        $this->savePackageStates($orderedPackageStates);

        return $orderedPackageStates;
    }
protected function sortAndSavePackageStates ( array $ packageStates ) { $ orderedPackageStates = $ this -> sortAvailablePackagesByDependencies ( $ packageStates ) ; $ this -> savePackageStates ( $ orderedPackageStates ) ; return $ orderedPackageStates ; }
Takes the given packageStatesConfiguration, sorts it by dependencies, saves it and returns
the ordered list

@param array $packageStates
@return array
Takes the given packageStatesConfiguration sorts it by dependencies saves it and returns the ordered list