original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Sorts the files by dependencies
  
  @param array $assets
  @return array
docstring_tokens: Sorts the files by dependencies