Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13978926
D9992.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D9992.id.diff
View Options
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
@@ -216,6 +216,7 @@
'PhutilLunarPhaseTestCase' => 'utils/__tests__/PhutilLunarPhaseTestCase.php',
'PhutilMarkupEngine' => 'markup/PhutilMarkupEngine.php',
'PhutilMarkupTestCase' => 'markup/__tests__/PhutilMarkupTestCase.php',
+ 'PhutilMethodNotImplementedException' => 'error/PhutilMethodNotImplementedException.php',
'PhutilMetricsChannel' => 'channel/PhutilMetricsChannel.php',
'PhutilMissingSymbolException' => 'symbols/exception/PhutilMissingSymbolException.php',
'PhutilModuleUtilsTestCase' => 'moduleutils/__tests__/PhutilModuleUtilsTestCase.php',
@@ -623,6 +624,7 @@
'PhutilLogfileChannel' => 'PhutilChannelChannel',
'PhutilLunarPhaseTestCase' => 'PhutilTestCase',
'PhutilMarkupTestCase' => 'PhutilTestCase',
+ 'PhutilMethodNotImplementedException' => 'Exception',
'PhutilMetricsChannel' => 'PhutilChannelChannel',
'PhutilMissingSymbolException' => 'Exception',
'PhutilModuleUtilsTestCase' => 'PhutilTestCase',
diff --git a/src/error/PhutilMethodNotImplementedException.php b/src/error/PhutilMethodNotImplementedException.php
new file mode 100644
--- /dev/null
+++ b/src/error/PhutilMethodNotImplementedException.php
@@ -0,0 +1,29 @@
+<?php
+
+/**
+ * An exception thrown when a method is called on a class which does not
+ * provide an implementation for the called method. This is sometimes the case
+ * when a base class expects subclasses to provide their own implementations,
+ * for example.
+ */
+final class PhutilMethodNotImplementedException extends Exception {
+
+ public function __construct($message = null) {
+ if ($message) {
+ parent::__construct($message);
+ } else {
+ $caller = idx(debug_backtrace(false), 1);
+
+ $class = idx($caller, 'class');
+ $function = idx($caller, 'function');
+
+ if ($class) {
+ parent::__construct(
+ pht('Method %s in class %s is not implemented!', $function, $class));
+ } else {
+ parent::__construct(pht('Function %s is not implemented!', $function));
+ }
+ }
+ }
+
+}
diff --git a/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineBlockRule.php b/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineBlockRule.php
--- a/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineBlockRule.php
+++ b/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineBlockRule.php
@@ -88,7 +88,7 @@
}
public function extractChildText($text) {
- throw new Exception(pht('Not implemented!'));
+ throw new PhutilMethodNotImplementedException();
}
protected function renderRemarkupTable(array $out_rows) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 20, 1:40 AM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6734669
Default Alt Text
D9992.id.diff (2 KB)
Attached To
Mode
D9992: Add a `PhutilMethodNotImplementedException` class
Attached
Detach File
Event Timeline
Log In to Comment