1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Make the PhabricatorApplication::getName() method abstract

Summary: In D10027, the `getName()` method was added to `PhabricatorApplication` to //allow// applications to explicitly declare their names rather than relying on the name being inferred from the name of the `PhabricatorApplication` subclass. I feel that sufficient time has passed such that we can //require// applications to explicitly declare their names.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11119
This commit is contained in:
Joshua Spence 2015-01-02 09:48:34 +11:00
parent a896494ce5
commit 22ee37e8b5

View file

@ -28,23 +28,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
/* -( Application Information )-------------------------------------------- */
/**
* TODO: This should be abstract, but is not for historical reasons.
*/
public function getName() {
phutil_deprecated(
'Automatic naming of `PhabricatorApplication` classes.',
'You should override the `getName` method.');
$match = null;
$regex = '/^PhabricatorApplication([A-Z][a-zA-Z]*)$/';
if (preg_match($regex, get_class($this), $match)) {
return $match[1];
}
throw new PhutilMethodNotImplementedException();
}
public abstract function getName();
public function getShortDescription() {
return $this->getName().' Application';