protected function sortFilesByDependencies($assets)
    {
        $sortedAssets = array();
        foreach ($assets as $asset) {
            if ($asset->hasDependencies()) {
                $sortedAssets = $this->resolveDependencies($sortedAssets, $assets, $asset);
            } else {
                $sortedAssets[$asset->getAssetName()] = $asset;
            }
        }
        
        return $sortedAssets;
    }
protected function sortFilesByDependencies($assets)
    {
        $sortedAssets = array();
        foreach ($assets as $asset) {
            if ($asset->hasDependencies()) {
                $sortedAssets = $this->resolveDependencies($sortedAssets, $assets, $asset);
            } else {
                $sortedAssets[$asset->getAssetName()] = $asset;
            }
        }
        
        return $sortedAssets;
    }
protected function sortFilesByDependencies ( $ assets ) { $ sortedAssets = array ( ) ; foreach ( $ assets as $ asset ) { if ( $ asset -> hasDependencies ( ) ) { $ sortedAssets = $ this -> resolveDependencies ( $ sortedAssets , $ assets , $ asset ) ; } else { $ sortedAssets [ $ asset -> getAssetName ( ) ] = $ asset ; } } return $ sortedAssets ; }
Sorts the files by dependencies

@param array $assets
@return array
Sorts the files by dependencies