1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 14:52:40 +01:00
phorge-arcanist/src/error/PhutilMethodNotImplementedException.php
epriestley 9b74cb4ee6 Fully merge "libphutil/" into "arcanist/"
Summary: Ref T13395. Moves all remaining code in "libphutil/" into "arcanist/".

Test Plan: Ran various arc workflows, although this probably has some remaining rough edges.

Maniphest Tasks: T13395

Differential Revision: https://secure.phabricator.com/D20980
2020-02-12 15:17:38 -08:00

34 lines
932 B
PHP

<?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(), 1);
if (isset($caller['object'])) {
$class = get_class($caller['object']);
} else {
$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));
}
}
}
}