mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-30 01:10:58 +01:00
Mark some PhabricatorApplication methods as final
Summary: I don't believe that any subclass should override these methods. Test Plan: `arc unit` Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D13265
This commit is contained in:
parent
ede0b61260
commit
934285a6d3
1 changed files with 18 additions and 18 deletions
|
@ -17,7 +17,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
|||
const GROUP_ADMIN = 'admin';
|
||||
const GROUP_DEVELOPER = 'developer';
|
||||
|
||||
public static function getApplicationGroups() {
|
||||
final public static function getApplicationGroups() {
|
||||
return array(
|
||||
self::GROUP_CORE => pht('Core Applications'),
|
||||
self::GROUP_UTILITIES => pht('Utilities'),
|
||||
|
@ -35,7 +35,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
|||
return pht('%s Application', $this->getName());
|
||||
}
|
||||
|
||||
public function isInstalled() {
|
||||
final public function isInstalled() {
|
||||
if (!$this->canUninstall()) {
|
||||
return true;
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
|||
return true;
|
||||
}
|
||||
|
||||
public function getPHID() {
|
||||
final public function getPHID() {
|
||||
return 'PHID-APPS-'.get_class($this);
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
|||
return null;
|
||||
}
|
||||
|
||||
public function getApplicationURI($path = '') {
|
||||
final public function getApplicationURI($path = '') {
|
||||
return $this->getBaseURI().ltrim($path, '/');
|
||||
}
|
||||
|
||||
|
@ -169,7 +169,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
|||
return null;
|
||||
}
|
||||
|
||||
public function getHelpMenuItems(PhabricatorUser $viewer) {
|
||||
final public function getHelpMenuItems(PhabricatorUser $viewer) {
|
||||
$items = array();
|
||||
|
||||
$articles = $this->getHelpDocumentationArticles($viewer);
|
||||
|
@ -249,7 +249,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
|||
return false;
|
||||
}
|
||||
|
||||
protected function getInboundEmailSupportLink() {
|
||||
final protected function getInboundEmailSupportLink() {
|
||||
return PhabricatorEnv::getDocLink('Configuring Inbound Email');
|
||||
}
|
||||
|
||||
|
@ -286,7 +286,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
|||
* @return string
|
||||
* @task ui
|
||||
*/
|
||||
public static function formatStatusCount(
|
||||
final public static function formatStatusCount(
|
||||
$count,
|
||||
$limit_string = '%s',
|
||||
$base_string = '%d') {
|
||||
|
@ -359,7 +359,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
|||
/* -( Application Management )--------------------------------------------- */
|
||||
|
||||
|
||||
public static function getByClass($class_name) {
|
||||
final public static function getByClass($class_name) {
|
||||
$selected = null;
|
||||
$applications = self::getAllApplications();
|
||||
|
||||
|
@ -377,7 +377,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
|||
return $selected;
|
||||
}
|
||||
|
||||
public static function getAllApplications() {
|
||||
final public static function getAllApplications() {
|
||||
static $applications;
|
||||
|
||||
if ($applications === null) {
|
||||
|
@ -401,7 +401,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
|||
return $applications;
|
||||
}
|
||||
|
||||
public static function getAllInstalledApplications() {
|
||||
final public static function getAllInstalledApplications() {
|
||||
$all_applications = self::getAllApplications();
|
||||
$apps = array();
|
||||
foreach ($all_applications as $app) {
|
||||
|
@ -426,7 +426,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
|||
* @return bool True if the class is installed.
|
||||
* @task meta
|
||||
*/
|
||||
public static function isClassInstalled($class) {
|
||||
final public static function isClassInstalled($class) {
|
||||
return self::getByClass($class)->isInstalled();
|
||||
}
|
||||
|
||||
|
@ -443,7 +443,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
|||
* @return bool True if the class is installed for the viewer.
|
||||
* @task meta
|
||||
*/
|
||||
public static function isClassInstalledForViewer(
|
||||
final public static function isClassInstalledForViewer(
|
||||
$class,
|
||||
PhabricatorUser $viewer) {
|
||||
|
||||
|
@ -502,7 +502,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
|||
return array();
|
||||
}
|
||||
|
||||
private function getCustomPolicySetting($capability) {
|
||||
final private function getCustomPolicySetting($capability) {
|
||||
if (!$this->isCapabilityEditable($capability)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -528,7 +528,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
|||
}
|
||||
|
||||
|
||||
private function getCustomCapabilitySpecification($capability) {
|
||||
final private function getCustomCapabilitySpecification($capability) {
|
||||
$custom = $this->getCustomCapabilities();
|
||||
if (!isset($custom[$capability])) {
|
||||
throw new Exception(pht("Unknown capability '%s'!", $capability));
|
||||
|
@ -536,7 +536,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
|||
return $custom[$capability];
|
||||
}
|
||||
|
||||
public function getCapabilityLabel($capability) {
|
||||
final public function getCapabilityLabel($capability) {
|
||||
switch ($capability) {
|
||||
case PhabricatorPolicyCapability::CAN_VIEW:
|
||||
return pht('Can Use Application');
|
||||
|
@ -552,7 +552,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
|||
return null;
|
||||
}
|
||||
|
||||
public function isCapabilityEditable($capability) {
|
||||
final public function isCapabilityEditable($capability) {
|
||||
switch ($capability) {
|
||||
case PhabricatorPolicyCapability::CAN_VIEW:
|
||||
return $this->canUninstall();
|
||||
|
@ -564,7 +564,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
|||
}
|
||||
}
|
||||
|
||||
public function getCapabilityCaption($capability) {
|
||||
final public function getCapabilityCaption($capability) {
|
||||
switch ($capability) {
|
||||
case PhabricatorPolicyCapability::CAN_VIEW:
|
||||
if (!$this->canUninstall()) {
|
||||
|
@ -582,7 +582,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
|||
}
|
||||
}
|
||||
|
||||
public function getCapabilityTemplatePHIDType($capability) {
|
||||
final public function getCapabilityTemplatePHIDType($capability) {
|
||||
switch ($capability) {
|
||||
case PhabricatorPolicyCapability::CAN_VIEW:
|
||||
case PhabricatorPolicyCapability::CAN_EDIT:
|
||||
|
|
Loading…
Reference in a new issue