Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / files / editor / PhabricatorFileEditor.php
blob91d168e68ddce277b3535c4388970e766ac19be9
1 <?php
3 final class PhabricatorFileEditor
4 extends PhabricatorApplicationTransactionEditor {
6 public function getEditorApplicationClass() {
7 return 'PhabricatorFilesApplication';
10 public function getEditorObjectsDescription() {
11 return pht('Files');
14 public function getTransactionTypes() {
15 $types = parent::getTransactionTypes();
17 $types[] = PhabricatorTransactions::TYPE_COMMENT;
18 $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
20 return $types;
23 protected function shouldSendMail(
24 PhabricatorLiskDAO $object,
25 array $xactions) {
26 return true;
29 protected function getMailSubjectPrefix() {
30 return pht('[File]');
33 protected function getMailTo(PhabricatorLiskDAO $object) {
34 return array(
35 $object->getAuthorPHID(),
36 $this->requireActor()->getPHID(),
40 protected function buildReplyHandler(PhabricatorLiskDAO $object) {
41 return id(new FileReplyHandler())
42 ->setMailReceiver($object);
45 protected function buildMailTemplate(PhabricatorLiskDAO $object) {
46 $id = $object->getID();
47 $name = $object->getName();
49 return id(new PhabricatorMetaMTAMail())
50 ->setSubject("F{$id}: {$name}");
53 protected function buildMailBody(
54 PhabricatorLiskDAO $object,
55 array $xactions) {
57 $body = parent::buildMailBody($object, $xactions);
59 $body->addTextSection(
60 pht('FILE DETAIL'),
61 PhabricatorEnv::getProductionURI($object->getInfoURI()));
63 return $body;
66 protected function shouldPublishFeedStory(
67 PhabricatorLiskDAO $object,
68 array $xactions) {
69 return true;
72 protected function supportsSearch() {
73 return true;