mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 08:12:40 +01:00
eb81fd1562
Summary: Fixes T7199. This still isn't a shining example of perfect code, but the raw amount of copy/paste is much lower than it used to be. - Reduce code duplication between existing receivers. - Expose receiving objects in help menus where appropriate. - Connect some "TODO" receivers. Test Plan: - Sent mail to every supported object type. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T7199 Differential Revision: https://secure.phabricator.com/D12249
27 lines
626 B
PHP
27 lines
626 B
PHP
<?php
|
|
|
|
final class PholioMockMailReceiver extends PhabricatorObjectMailReceiver {
|
|
|
|
public function isEnabled() {
|
|
$app_class = 'PhabricatorPholioApplication';
|
|
return PhabricatorApplication::isClassInstalled($app_class);
|
|
}
|
|
|
|
protected function getObjectPattern() {
|
|
return 'M[1-9]\d*';
|
|
}
|
|
|
|
protected function loadObject($pattern, PhabricatorUser $viewer) {
|
|
$id = (int)trim($pattern, 'M');
|
|
|
|
return id(new PholioMockQuery())
|
|
->setViewer($viewer)
|
|
->withIDs(array($id))
|
|
->executeOne();
|
|
}
|
|
|
|
protected function getTransactionReplyHandler() {
|
|
return new PholioReplyHandler();
|
|
}
|
|
|
|
}
|