public function mapByHash($feed)
  {
    $torrents = [];

    foreach ($feed as $torrent) {
      $hash = $torrent->getSeriesHash();

      if(!isset($torrents[$hash])) {
        $torrents[$hash] = new NyaaSet($hash);
      }

      $torrents[$hash]->add($torrent);
    }

    return $torrents;
  }
public function mapByHash($feed)
  {
    $torrents = [];

    foreach ($feed as $torrent) {
      $hash = $torrent->getSeriesHash();

      if(!isset($torrents[$hash])) {
        $torrents[$hash] = new NyaaSet($hash);
      }

      $torrents[$hash]->add($torrent);
    }

    return $torrents;
  }
public function mapByHash ( $ feed ) { $ torrents = [ ] ; foreach ( $ feed as $ torrent ) { $ hash = $ torrent -> getSeriesHash ( ) ; if ( ! isset ( $ torrents [ $ hash ] ) ) { $ torrents [ $ hash ] = new NyaaSet ( $ hash ) ; } $ torrents [ $ hash ] -> add ( $ torrent ) ; } return $ torrents ; }
Maps the torrents by series hash and collects them in a NyaaSet

@param NyaaTorrent[] list of torrents to be mapped
@param NyaaSet[]
Maps the torrents by series hash and collects them in a NyaaSet