Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/option/PhabricatorConfigOption.php
Show First 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | final class PhabricatorConfigOption | ||||
public function getSummary() { | public function getSummary() { | ||||
if (empty($this->summary)) { | if (empty($this->summary)) { | ||||
return $this->getDescription(); | return $this->getDescription(); | ||||
} | } | ||||
return $this->summary; | return $this->summary; | ||||
} | } | ||||
/** | |||||
* Set the human Description of this Config | |||||
* | |||||
* @param string|null $description Description as raw Remarkup | |||||
* @return self | |||||
*/ | |||||
public function setDescription($description) { | public function setDescription($description) { | ||||
$this->description = $description; | $this->description = $description; | ||||
return $this; | return $this; | ||||
} | } | ||||
/** | |||||
* Get the human Description of this Config | |||||
* | |||||
* @return string|null Description as raw Remarkup | |||||
*/ | |||||
public function getDescription() { | public function getDescription() { | ||||
return $this->description; | return $this->description; | ||||
} | } | ||||
public function setType($type) { | public function setType($type) { | ||||
$this->type = $type; | $this->type = $type; | ||||
return $this; | return $this; | ||||
} | } | ||||
Show All 28 Lines | final class PhabricatorConfigOption | ||||
public function setCustomData($data) { | public function setCustomData($data) { | ||||
$this->customData = $data; | $this->customData = $data; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function newDescriptionRemarkupView(PhabricatorUser $viewer) { | public function newDescriptionRemarkupView(PhabricatorUser $viewer) { | ||||
$description = $this->getDescription(); | $description = $this->getDescription(); | ||||
if (!strlen($description)) { | if (!phutil_nonempty_string($description)) { | ||||
return null; | return null; | ||||
} | } | ||||
return new PHUIRemarkupView($viewer, $description); | return new PHUIRemarkupView($viewer, $description); | ||||
valerio.bozzolan: ✅ Note that `$description` must be a string (and not some fancy string builders) since the… | |||||
} | } | ||||
} | } |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
✅ Note that $description must be a string (and not some fancy string builders) since the example declared in PHUIRemarkupView.php is