private function raiseGraphCycleException(PhabricatorEdgeCycleException $ex) { $cycle = $ex->getCycle(); $handles = $this->loadViewerHandles($cycle); $names = array(); foreach ($cycle as $cycle_phid) { $names[] = $handles[$cycle_phid]->getFullName(); } $names = implode(" → ", $names); throw new Exception("You can not create that dependency, because it would create a " . "circular dependency: {$names}."); }
private function newGraphCycleResponse(PhabricatorEdgeCycleException $ex, $done_uri) { $viewer = $this->getViewer(); $cycle = $ex->getCycle(); $handles = $this->loadViewerHandles($cycle); $names = array(); foreach ($cycle as $cycle_phid) { $names[] = $handles[$cycle_phid]->getFullName(); } $message = pht('You can not create that relationship because it would create a ' . 'circular dependency:'); $list = implode(" → ", $names); return $this->newDialog()->setTitle(pht('Circular Dependency'))->appendParagraph($message)->appendParagraph($list)->addCancelButton($done_uri); }