original_string: protected function _resolveDependencies(Asset $asset, &$resolved = [], &$unresolved = [])
      {
          $unresolved[$asset->getAlias()] = $asset;
  
          foreach ($asset->getDependencies() as $dependency) {
              if (!Arr::key($dependency, $resolved)) {
  
                  if (isset($unresolved[$dependency])) {
                      throw new Exception(sprintf(
                          'Circular asset dependency "%s > %s" detected.',
                          $asset->getAlias(),
                          $dependency
                      ));
                  }
  
                  if ($dep = $this->_collection->get($dependency)) {
                      $this->_resolveDependencies($dep, $resolved, $unresolved);
                  } else {
                      throw new Exception("Undefined depends: $dependency");
                  }
              }
          }
  
          $resolved[$asset->getAlias()] = $asset;
          unset($unresolved[$asset->getAlias()]);
  
          return $resolved;
      }
code: protected function _resolveDependencies(Asset $asset, &$resolved = [], &$unresolved = [])
      {
          $unresolved[$asset->getAlias()] = $asset;
  
          foreach ($asset->getDependencies() as $dependency) {
              if (!Arr::key($dependency, $resolved)) {
  
                  if (isset($unresolved[$dependency])) {
                      throw new Exception(sprintf(
                          'Circular asset dependency "%s > %s" detected.',
                          $asset->getAlias(),
                          $dependency
                      ));
                  }
  
                  if ($dep = $this->_collection->get($dependency)) {
                      $this->_resolveDependencies($dep, $resolved, $unresolved);
                  } else {
                      throw new Exception("Undefined depends: $dependency");
                  }
              }
          }
  
          $resolved[$asset->getAlias()] = $asset;
          unset($unresolved[$asset->getAlias()]);
  
          return $resolved;
      }
code_tokens: protected function _resolveDependencies ( Asset $ asset , & $ resolved = [ ] , & $ unresolved = [ ] ) { $ unresolved [ $ asset -> getAlias ( ) ] = $ asset ; foreach ( $ asset -> getDependencies ( ) as $ dependency ) { if ( ! Arr :: key ( $ dependency , $ resolved ) ) { if ( isset ( $ unresolved [ $ dependency ] ) ) { throw new Exception ( sprintf ( 'Circular asset dependency "%s > %s" detected.' , $ asset -> getAlias ( ) , $ dependency ) ) ; } if ( $ dep = $ this -> _collection -> get ( $ dependency ) ) { $ this -> _resolveDependencies ( $ dep , $ resolved , $ unresolved ) ; } else { throw new Exception ( "Undefined depends: $dependency" ) ; } } } $ resolved [ $ asset -> getAlias ( ) ] = $ asset ; unset ( $ unresolved [ $ asset -> getAlias ( ) ] ) ; return $ resolved ; }
docstring: Resolves asset dependencies.
  
  @param Asset|null $asset
  @param Asset[]    $resolved
  @param Asset[]    $unresolved
  @return Asset[]
  @throws Exception
docstring_tokens: Resolves asset dependencies .