Differential D25162 Diff 595 src/applications/transactions/editengine/PhabricatorEditEngineSubtype.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/editengine/PhabricatorEditEngineSubtype.php
Show All 37 Lines | public function setIcon($icon) { | ||||
$this->icon = $icon; | $this->icon = $icon; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getIcon() { | public function getIcon() { | ||||
return $this->icon; | return $this->icon; | ||||
} | } | ||||
/** | |||||
* Set the text of the tag | |||||
* | |||||
* This is usually the 'name' key of your subtype map. | |||||
* Sometime this is an uppercase text like 'BUG' for a 'bug' subtype name. | |||||
* | |||||
* @param string|null $text | |||||
* @return self | |||||
*/ | |||||
public function setTagText($text) { | public function setTagText($text) { | ||||
$this->tagText = $text; | $this->tagText = $text; | ||||
return $this; | return $this; | ||||
} | } | ||||
/** | |||||
* Get the text of the tag | |||||
* | |||||
* @see PhabricatorEditEngineSubtype::setTagText() | |||||
* | |||||
* @return string|null | |||||
*/ | |||||
public function getTagText() { | public function getTagText() { | ||||
return $this->tagText; | return $this->tagText; | ||||
} | } | ||||
public function setColor($color) { | public function setColor($color) { | ||||
$this->color = $color; | $this->color = $color; | ||||
return $this; | return $this; | ||||
} | } | ||||
Show All 25 Lines | public function setMutations($mutations) { | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getMutations() { | public function getMutations() { | ||||
return $this->mutations; | return $this->mutations; | ||||
} | } | ||||
public function hasTagView() { | public function hasTagView() { | ||||
return (bool)strlen($this->getTagText()); | return phutil_nonempty_string($this->getTagText()); | ||||
valerio.bozzolan: ✅ The only usage of `setTagText()` seems to be in `PhabricatorEditEngineSubtype` and the input… | |||||
} | } | ||||
public function newTagView() { | public function newTagView() { | ||||
$view = id(new PHUITagView()) | $view = id(new PHUITagView()) | ||||
->setType(PHUITagView::TYPE_OUTLINE) | ->setType(PHUITagView::TYPE_OUTLINE) | ||||
->setName($this->getTagText()); | ->setName($this->getTagText()); | ||||
$color = $this->getColor(); | $color = $this->getColor(); | ||||
▲ Show 20 Lines • Show All 217 Lines • Show Last 20 Lines |
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
✅ The only usage of setTagText() seems to be in PhabricatorEditEngineSubtype and the input domain is just a string coming from phutil_utf8_strtoupper() (like "BUG") or null (default). The phutil_nonempty_string() will report alien values and this is OK.
Also, the method was returning a bool, and it still returns a bool.