Page MenuHomePhabricator

D7517.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -139,6 +139,7 @@
'PhutilDefaultSyntaxHighlighterEngineTestCase' => 'markup/syntax/engine/__tests__/PhutilDefaultSyntaxHighlighterEngineTestCase.php',
'PhutilDeferredLog' => 'filesystem/PhutilDeferredLog.php',
'PhutilDeferredLogTestCase' => 'filesystem/__tests__/PhutilDeferredLogTestCase.php',
+ 'PhutilDirectedScalarGraph' => 'utils/PhutilDirectedScalarGraph.php',
'PhutilDirectoryFixture' => 'filesystem/PhutilDirectoryFixture.php',
'PhutilDivinerSyntaxHighlighter' => 'markup/syntax/highlighter/PhutilDivinerSyntaxHighlighter.php',
'PhutilDocblockParser' => 'parser/PhutilDocblockParser.php',
@@ -519,6 +520,7 @@
'PhutilDefaultSyntaxHighlighterEnginePygmentsFuture' => 'FutureProxy',
'PhutilDefaultSyntaxHighlighterEngineTestCase' => 'PhutilTestCase',
'PhutilDeferredLogTestCase' => 'PhutilTestCase',
+ 'PhutilDirectedScalarGraph' => 'AbstractDirectedGraph',
'PhutilDocblockParserTestCase' => 'PhutilTestCase',
'PhutilEditDistanceMatrixTestCase' => 'PhutilTestCase',
'PhutilEmailAddressTestCase' => 'PhutilTestCase',
diff --git a/src/utils/PhutilDirectedScalarGraph.php b/src/utils/PhutilDirectedScalarGraph.php
new file mode 100644
--- /dev/null
+++ b/src/utils/PhutilDirectedScalarGraph.php
@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * Concrete subclass of @{class:AbstractDirectedGraph} which can not load any
+ * data from external sources.
+ */
+final class PhutilDirectedScalarGraph extends AbstractDirectedGraph {
+
+ protected function loadEdges(array $nodes) {
+ throw new Exception(
+ "PhutilDirectedScalarGraph can not load additional nodes at runtime. ".
+ "Tried to load: ".implode(', ', $nodes));
+ }
+
+}

File Metadata

Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/kw/cs/ocnlgdhd4d7hexhk
Default Alt Text
D7517.diff (1 KB)

Event Timeline