Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/diviner/renderer/DivinerRenderer.php
12256 views
1
<?php
2
3
abstract 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
}
41
42