Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/celerity/CelerityResourceGraph.php
12249 views
1
<?php
2
3
final 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
}
31
32