Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / repository / xaction / PhabricatorRepositoryTrackOnlyTransaction.php
blob5fdc26e792760f3a4583ec26fd6434782032c130
1 <?php
3 final class PhabricatorRepositoryTrackOnlyTransaction
4 extends PhabricatorRepositoryTransactionType {
6 const TRANSACTIONTYPE = 'repo:track-only';
8 public function generateOldValue($object) {
9 return $object->getTrackOnlyRules();
12 public function applyInternalEffects($object, $value) {
13 $object->setTrackOnlyRules($value);
16 public function getTitle() {
17 $old = $this->getOldValue();
18 $new = $this->getNewValue();
20 if (!$new) {
21 return pht(
22 '%s set this repository to track all branches.',
23 $this->renderAuthor());
24 } else if (!$old) {
25 return pht(
26 '%s set this repository to track branches: %s.',
27 $this->renderAuthor(),
28 $this->renderValue(implode(', ', $new)));
29 } else {
30 return pht(
31 '%s changed tracked branches from %s to %s.',
32 $this->renderAuthor(),
33 $this->renderValue(implode(', ', $old)),
34 $this->renderValue(implode(', ', $new)));
38 public function validateTransactions($object, array $xactions) {
39 return $this->validateRefList($object, $xactions);