Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / repository / xaction / PhabricatorRepositoryPermanentRefsTransaction.php
blob345a9092f0f84df0fd80bfe19140b6b608a625cc
1 <?php
3 final class PhabricatorRepositoryPermanentRefsTransaction
4 extends PhabricatorRepositoryTransactionType {
6 const TRANSACTIONTYPE = 'repo:autoclose-only';
8 public function generateOldValue($object) {
9 return $object->getPermanentRefRules();
12 public function applyInternalEffects($object, $value) {
13 $object->setPermanentRefRules($value);
16 public function getTitle() {
17 $old = $this->getOldValue();
18 $new = $this->getNewValue();
20 if (!$new) {
21 return pht(
22 '%s marked all branches in this repository as permanent.',
23 $this->renderAuthor());
24 } else if (!$old) {
25 return pht(
26 '%s set the permanent refs for this repository to: %s.',
27 $this->renderAuthor(),
28 $this->renderValue(implode(', ', $new)));
29 } else {
30 return pht(
31 '%s changed permanent refs for this repository 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);