Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / herald / state / HeraldStateReasons.php
blobd85e8b713f1797630beb3f9b3b63657288a18c2b
1 <?php
3 abstract class HeraldStateReasons extends Phobject {
5 abstract public function explainReason($reason);
7 final public static function getAllReasons() {
8 return id(new PhutilClassMapQuery())
9 ->setAncestorClass(__CLASS__)
10 ->execute();
13 final public static function getExplanation($reason) {
14 $reasons = self::getAllReasons();
16 foreach ($reasons as $reason_implementation) {
17 $explanation = $reason_implementation->explainReason($reason);
18 if ($explanation !== null) {
19 return $explanation;
23 return pht('Unknown reason ("%s").', $reason);