Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / repository / xaction / PhabricatorRepositoryMaintenanceTransaction.php
blobcaf9e84527d67f451053686a9f3f3aaf9551d622
1 <?php
3 final class PhabricatorRepositoryMaintenanceTransaction
4 extends PhabricatorRepositoryTransactionType {
6 const TRANSACTIONTYPE = 'maintenance';
8 public function generateOldValue($object) {
9 return $object->getReadOnlyMessage();
12 public function applyInternalEffects($object, $value) {
13 if ($value === null) {
14 $object
15 ->setReadOnly(false)
16 ->setReadOnlyMessage(null);
17 } else {
18 $object
19 ->setReadOnly(true)
20 ->setReadOnlyMessage($value);
24 public function getTitle() {
25 $old = $this->getOldValue();
26 $new = $this->getNewValue();
28 if (strlen($old) && !strlen($new)) {
29 return pht(
30 '%s took this repository out of maintenance mode.',
31 $this->renderAuthor());
32 } else if (!strlen($old) && strlen($new)) {
33 return pht(
34 '%s put this repository into maintenance mode.',
35 $this->renderAuthor());
36 } else {
37 return pht(
38 '%s updated the maintenance message for this repository.',
39 $this->renderAuthor());