Something went wrong. Try again.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
Something went wrong. Try again.
PHP
1234567891011121314151617181920212223242526272829303132333435363738394041424344<?php
abstract class DiffusionLowLevelQuery extends Phobject {
private $repository;
abstract protected function executeQuery();
public function setRepository(PhabricatorRepository $repository) { $this->repository = $repository; return $this; }
public function getRepository() { return $this->repository; }
public function execute() { if (!$this->getRepository()) { throw new PhutilInvalidStateException('setRepository'); }
return $this->executeQuery(); }
protected function filterRefsByType(array $refs, array $types) { $type_map = array_fuse($types);
foreach ($refs as $name => $ref_list) { foreach ($ref_list as $key => $ref) { if (empty($type_map[$ref['type']])) { unset($refs[$name][$key]); } } if (!$refs[$name]) { unset($refs[$name]); } }
return $refs; }
}