Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / repository / xaction / PhabricatorRepositoryDefaultBranchTransaction.php
blob23eebf60c86389fad81701b5d6b512311a26b4ee
1 <?php
3 final class PhabricatorRepositoryDefaultBranchTransaction
4 extends PhabricatorRepositoryTransactionType {
6 const TRANSACTIONTYPE = 'repo:default-branch';
8 public function generateOldValue($object) {
9 return $object->getDetail('default-branch');
12 public function applyInternalEffects($object, $value) {
13 $object->setDetail('default-branch', $value);
16 public function getTitle() {
17 $old = $this->getOldValue();
18 $new = $this->getNewValue();
20 if (!strlen($new)) {
21 return pht(
22 '%s removed %s as the default branch.',
23 $this->renderAuthor(),
24 $this->renderOldValue());
25 } else if (!strlen($old)) {
26 return pht(
27 '%s set the default branch to %s.',
28 $this->renderAuthor(),
29 $this->renderNewValue());
30 } else {
31 return pht(
32 '%s changed the default branch from %s to %s.',
33 $this->renderAuthor(),
34 $this->renderOldValue(),
35 $this->renderNewValue());