Differential D25265 Diff 904 src/applications/repository/xaction/PhabricatorRepositoryDefaultBranchTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/xaction/PhabricatorRepositoryDefaultBranchTransaction.php
Show All 11 Lines | final class PhabricatorRepositoryDefaultBranchTransaction | ||||
public function applyInternalEffects($object, $value) { | public function applyInternalEffects($object, $value) { | ||||
$object->setDetail('default-branch', $value); | $object->setDetail('default-branch', $value); | ||||
} | } | ||||
public function getTitle() { | public function getTitle() { | ||||
$old = $this->getOldValue(); | $old = $this->getOldValue(); | ||||
$new = $this->getNewValue(); | $new = $this->getNewValue(); | ||||
if (!strlen($new)) { | if (!phutil_nonempty_string($new)) { | ||||
return pht( | return pht( | ||||
'%s removed %s as the default branch.', | '%s removed %s as the default branch.', | ||||
$this->renderAuthor(), | $this->renderAuthor(), | ||||
$this->renderOldValue()); | $this->renderOldValue()); | ||||
} else if (!strlen($old)) { | } else if (!phutil_nonempty_string($old)) { | ||||
speck: Please update both conditions here as I think `$new` can also be null | |||||
return pht( | return pht( | ||||
'%s set the default branch to %s.', | '%s set the default branch to %s.', | ||||
$this->renderAuthor(), | $this->renderAuthor(), | ||||
$this->renderNewValue()); | $this->renderNewValue()); | ||||
} else { | } else { | ||||
return pht( | return pht( | ||||
'%s changed the default branch from %s to %s.', | '%s changed the default branch from %s to %s.', | ||||
$this->renderAuthor(), | $this->renderAuthor(), | ||||
$this->renderOldValue(), | $this->renderOldValue(), | ||||
$this->renderNewValue()); | $this->renderNewValue()); | ||||
} | } | ||||
} | } | ||||
} | } |
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
Please update both conditions here as I think $new can also be null