Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / packages / view / PhabricatorPackagesVersionListView.php
blob45840016eedacdcae1ebfe7ec0e3d4a75532ce6d
1 <?php
3 final class PhabricatorPackagesVersionListView
4 extends PhabricatorPackagesView {
6 private $versions;
8 public function setVersions(array $versions) {
9 assert_instances_of($versions, 'PhabricatorPackagesVersion');
10 $this->versions = $versions;
11 return $this;
14 public function getVersions() {
15 return $this->versions;
18 public function render() {
19 return $this->newListView();
22 public function newListView() {
23 $viewer = $this->getViewer();
24 $versions = $this->getVersions();
26 $list = id(new PHUIObjectItemListView())
27 ->setViewer($viewer);
29 foreach ($versions as $version) {
30 $item = id(new PHUIObjectItemView())
31 ->setHeader($version->getName())
32 ->setHref($version->getURI());
34 $list->addItem($item);
37 return $list;