mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-11 17:32:41 +01:00
bb0a39a48c
Summary: This doesn't do anything, but touches a bunch of files so I split it out to reduce the size of the next diff. Basically, make `MailReceiver` classes responsible for loading their application objects. Ref T1205. Test Plan: Inspection / next diff / code is not reached. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T1205 Differential Revision: https://secure.phabricator.com/D5941
24 lines
543 B
PHP
24 lines
543 B
PHP
<?php
|
|
|
|
final class ReleephRequestMailReceiver extends PhabricatorObjectMailReceiver {
|
|
|
|
public function isEnabled() {
|
|
$app_class = 'PhabricatorApplicationReleeph';
|
|
return PhabricatorApplication::isClassInstalled($app_class);
|
|
}
|
|
|
|
protected function getObjectPattern() {
|
|
return 'RQ[1-9]\d*';
|
|
}
|
|
|
|
protected function loadObject($pattern, PhabricatorUser $viewer) {
|
|
$id = (int)substr($pattern, 2);
|
|
|
|
return id(new ReleephRequestQuery())
|
|
->setViewer($viewer)
|
|
->withIDs(array($id))
|
|
->executeOne();
|
|
}
|
|
|
|
|
|
}
|