1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-04-13 12:58:38 +02:00
phorge-arcanist/src/exception/PhutilInvalidStateException.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

30 lines
622 B
PHP

<?php
final class PhutilInvalidStateException extends Exception {
private $callee;
private $function;
public function __construct($function, $callee = null) {
if ($callee === null) {
$callee = idx(debug_backtrace(), 1);
$callee = idx($callee, 'function');
}
$this->callee = $callee;
$this->function = $function;
parent::__construct(
pht(
'Call %s before calling %s!',
$this->function.'()',
$this->callee.'()'));
}
public function getCallee() {
return $this->callee;
}
public function getFunction() {
return $this->function;
}
}