protected function resolveDependencies($sortedAssets, $assets, $asset)
    {
        if ($asset->hasDependencies()) {
            foreach ($asset->getDependencies() as $dependency) {
                if (!isset($sortedAssets[$dependency]) && isset($assets[$dependency])) {
                    $sortedAssets = $this->resolveDependencies($sortedAssets, $assets, $assets[$dependency]);
                }
            }
        }
        
        $sortedAssets[$asset->getAssetName()] = $asset;
        
        return $sortedAssets;
    }
protected function resolveDependencies($sortedAssets, $assets, $asset)
    {
        if ($asset->hasDependencies()) {
            foreach ($asset->getDependencies() as $dependency) {
                if (!isset($sortedAssets[$dependency]) && isset($assets[$dependency])) {
                    $sortedAssets = $this->resolveDependencies($sortedAssets, $assets, $assets[$dependency]);
                }
            }
        }
        
        $sortedAssets[$asset->getAssetName()] = $asset;
        
        return $sortedAssets;
    }
protected function resolveDependencies ( $ sortedAssets , $ assets , $ asset ) { if ( $ asset -> hasDependencies ( ) ) { foreach ( $ asset -> getDependencies ( ) as $ dependency ) { if ( ! isset ( $ sortedAssets [ $ dependency ] ) && isset ( $ assets [ $ dependency ] ) ) { $ sortedAssets = $ this -> resolveDependencies ( $ sortedAssets , $ assets , $ assets [ $ dependency ] ) ; } } } $ sortedAssets [ $ asset -> getAssetName ( ) ] = $ asset ; return $ sortedAssets ; }
Returns the sorted assets with all dependencies

@param array $sortedAssets
@param array $assets
@param \Zepi\Web\General\Entity\Asset $asset
@return array
Returns the sorted assets with all dependencies