@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 30 lines 678 B view raw
1<?php 2 3final class CelerityResourceGraph extends AbstractDirectedGraph { 4 5 private $resourceGraph = array(); 6 private $graphSet = false; 7 8 protected function loadEdges(array $nodes) { 9 if (!$this->graphSet) { 10 throw new PhutilInvalidStateException('setResourceGraph'); 11 } 12 13 $graph = $this->getResourceGraph(); 14 $edges = array(); 15 foreach ($nodes as $node) { 16 $edges[$node] = idx($graph, $node, array()); 17 } 18 return $edges; 19 } 20 21 public function setResourceGraph(array $graph) { 22 $this->resourceGraph = $graph; 23 $this->graphSet = true; 24 return $this; 25 } 26 27 private function getResourceGraph() { 28 return $this->resourceGraph; 29 } 30}