@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
at upstream/main 40 lines 937 B view raw
1<?php 2 3abstract class DivinerRenderer extends Phobject { 4 5 private $publisher; 6 private $atomStack = array(); 7 8 public function setPublisher($publisher) { 9 $this->publisher = $publisher; 10 return $this; 11 } 12 13 public function getPublisher() { 14 return $this->publisher; 15 } 16 17 public function getConfig($key, $default = null) { 18 return $this->getPublisher()->getConfig($key, $default); 19 } 20 21 protected function pushAtomStack(DivinerAtom $atom) { 22 $this->atomStack[] = $atom; 23 return $this; 24 } 25 26 protected function peekAtomStack() { 27 return end($this->atomStack); 28 } 29 30 protected function popAtomStack() { 31 array_pop($this->atomStack); 32 return $this; 33 } 34 35 abstract public function renderAtom(DivinerAtom $atom); 36 abstract public function renderAtomSummary(DivinerAtom $atom); 37 abstract public function renderAtomIndex(array $refs); 38 abstract public function getHrefForAtomRef(DivinerAtomRef $ref); 39 40}