Differential D25185 Diff 665 src/applications/spaces/xaction/PhabricatorSpacesNamespaceNameTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/spaces/xaction/PhabricatorSpacesNamespaceNameTransaction.php
Show All 9 Lines | final class PhabricatorSpacesNamespaceNameTransaction | ||||
} | } | ||||
public function applyInternalEffects($object, $value) { | public function applyInternalEffects($object, $value) { | ||||
$object->setNamespaceName($value); | $object->setNamespaceName($value); | ||||
} | } | ||||
public function getTitle() { | public function getTitle() { | ||||
$old = $this->getOldValue(); | $old = $this->getOldValue(); | ||||
if (!strlen($old)) { | if (!phutil_nonempty_string($old)) { | ||||
valerio.bozzolan: ✅ The value `$old` always is NULL at startup, or is a string after a rename.
The function… | |||||
return pht( | return pht( | ||||
'%s created this space.', | '%s created this space.', | ||||
$this->renderAuthor()); | $this->renderAuthor()); | ||||
} else { | } else { | ||||
return pht( | return pht( | ||||
'%s renamed this space from %s to %s.', | '%s renamed this space from %s to %s.', | ||||
$this->renderAuthor(), | $this->renderAuthor(), | ||||
$this->renderOldValue(), | $this->renderOldValue(), | ||||
Show All 36 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 value $old always is NULL at startup, or is a string after a rename.
The function phutil_nonempty_string() will report any alien type, and that is OK.