public function filterDuplicates($torrents)
  {
    $arr = [];

    foreach ($torrents as $torrent) {
      $arr[$torrent->getTorrentId()] = $torrent;
    }

    return array_values($arr);
  }
public function filterDuplicates($torrents)
  {
    $arr = [];

    foreach ($torrents as $torrent) {
      $arr[$torrent->getTorrentId()] = $torrent;
    }

    return array_values($arr);
  }
public function filterDuplicates ( $ torrents ) { $ arr = [ ] ; foreach ( $ torrents as $ torrent ) { $ arr [ $ torrent -> getTorrentId ( ) ] = $ torrent ; } return array_values ( $ arr ) ; }
Return list with unique torrents from given array

@param NyaaTorrent[] The list to filter duplicates out
@param NyaaTorrent[]
Return list with unique torrents from given array