Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / guides / guidance / PhabricatorGuidanceMessage.php
blobd2720c1602825bbf2a7a714271f3c9861efecc19
1 <?php
3 final class PhabricatorGuidanceMessage
4 extends Phobject {
6 private $key;
7 private $message;
8 private $severity = self::SEVERITY_NOTICE;
9 private $priority = 1000;
11 const SEVERITY_NOTICE = 'notice';
12 const SEVERITY_WARNING = 'warning';
14 public function setSeverity($severity) {
15 $this->severity = $severity;
16 return $this;
19 public function getSeverity() {
20 return $this->severity;
23 public function setKey($key) {
24 $this->key = $key;
25 return $this;
28 public function getKey() {
29 return $this->key;
32 public function setMessage($message) {
33 $this->message = $message;
34 return $this;
37 public function getMessage() {
38 return $this->message;
41 public function getSortVector() {
42 return id(new PhutilSortVector())
43 ->addInt($this->getPriority());
46 public function setPriority($priority) {
47 $this->priority = $priority;
48 return $this;
51 public function getPriority() {
52 return $this->priority;
55 public function getSeverityStrength() {
56 $map = array(
57 self::SEVERITY_NOTICE => 1,
58 self::SEVERITY_WARNING => 2,
61 return idx($map, $this->getSeverity(), 0);