Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / macro / xaction / PhabricatorMacroAudioTransaction.php
blobbb966a16cbc90d362956c8f45830268170cb210c
1 <?php
3 final class PhabricatorMacroAudioTransaction
4 extends PhabricatorMacroTransactionType {
6 const TRANSACTIONTYPE = 'macro:audio';
8 public function generateOldValue($object) {
9 return $object->getAudioPHID();
12 public function applyInternalEffects($object, $value) {
13 $object->setAudioPHID($value);
16 public function extractFilePHIDs($object, $value) {
17 $file_phids = array();
19 if ($value) {
20 $file_phids[] = $value;
23 return $file_phids;
26 public function getTitle() {
27 $new = $this->getNewValue();
28 $old = $this->getOldValue();
29 if (!$old) {
30 return pht(
31 '%s attached audio: %s.',
32 $this->renderAuthor(),
33 $this->renderHandle($new));
34 } else {
35 return pht(
36 '%s changed the audio for this macro from %s to %s.',
37 $this->renderAuthor(),
38 $this->renderHandle($old),
39 $this->renderHandle($new));
43 public function getTitleForFeed() {
44 $new = $this->getNewValue();
45 $old = $this->getOldValue();
46 if (!$old) {
47 return pht(
48 '%s attached audio to %s: %s.',
49 $this->renderAuthor(),
50 $this->renderObject(),
51 $this->renderHandle($new));
52 } else {
53 return pht(
54 '%s changed the audio for %s from %s to %s.',
55 $this->renderAuthor(),
56 $this->renderObject(),
57 $this->renderHandle($old),
58 $this->renderHandle($new));
62 public function getIcon() {
63 return 'fa-music';