@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+18 -18
+18 -18
src/applications/base/PhabricatorApplication.php
··· 17 17 const GROUP_ADMIN = 'admin'; 18 18 const GROUP_DEVELOPER = 'developer'; 19 19 20 - public static function getApplicationGroups() { 20 + final public static function getApplicationGroups() { 21 21 return array( 22 22 self::GROUP_CORE => pht('Core Applications'), 23 23 self::GROUP_UTILITIES => pht('Utilities'), ··· 35 35 return pht('%s Application', $this->getName()); 36 36 } 37 37 38 - public function isInstalled() { 38 + final public function isInstalled() { 39 39 if (!$this->canUninstall()) { 40 40 return true; 41 41 } ··· 133 133 return true; 134 134 } 135 135 136 - public function getPHID() { 136 + final public function getPHID() { 137 137 return 'PHID-APPS-'.get_class($this); 138 138 } 139 139 ··· 145 145 return null; 146 146 } 147 147 148 - public function getApplicationURI($path = '') { 148 + final public function getApplicationURI($path = '') { 149 149 return $this->getBaseURI().ltrim($path, '/'); 150 150 } 151 151 ··· 169 169 return null; 170 170 } 171 171 172 - public function getHelpMenuItems(PhabricatorUser $viewer) { 172 + final public function getHelpMenuItems(PhabricatorUser $viewer) { 173 173 $items = array(); 174 174 175 175 $articles = $this->getHelpDocumentationArticles($viewer); ··· 249 249 return false; 250 250 } 251 251 252 - protected function getInboundEmailSupportLink() { 252 + final protected function getInboundEmailSupportLink() { 253 253 return PhabricatorEnv::getDocLink('Configuring Inbound Email'); 254 254 } 255 255 ··· 286 286 * @return string 287 287 * @task ui 288 288 */ 289 - public static function formatStatusCount( 289 + final public static function formatStatusCount( 290 290 $count, 291 291 $limit_string = '%s', 292 292 $base_string = '%d') { ··· 359 359 /* -( Application Management )--------------------------------------------- */ 360 360 361 361 362 - public static function getByClass($class_name) { 362 + final public static function getByClass($class_name) { 363 363 $selected = null; 364 364 $applications = self::getAllApplications(); 365 365 ··· 377 377 return $selected; 378 378 } 379 379 380 - public static function getAllApplications() { 380 + final public static function getAllApplications() { 381 381 static $applications; 382 382 383 383 if ($applications === null) { ··· 401 401 return $applications; 402 402 } 403 403 404 - public static function getAllInstalledApplications() { 404 + final public static function getAllInstalledApplications() { 405 405 $all_applications = self::getAllApplications(); 406 406 $apps = array(); 407 407 foreach ($all_applications as $app) { ··· 426 426 * @return bool True if the class is installed. 427 427 * @task meta 428 428 */ 429 - public static function isClassInstalled($class) { 429 + final public static function isClassInstalled($class) { 430 430 return self::getByClass($class)->isInstalled(); 431 431 } 432 432 ··· 443 443 * @return bool True if the class is installed for the viewer. 444 444 * @task meta 445 445 */ 446 - public static function isClassInstalledForViewer( 446 + final public static function isClassInstalledForViewer( 447 447 $class, 448 448 PhabricatorUser $viewer) { 449 449 ··· 502 502 return array(); 503 503 } 504 504 505 - private function getCustomPolicySetting($capability) { 505 + final private function getCustomPolicySetting($capability) { 506 506 if (!$this->isCapabilityEditable($capability)) { 507 507 return null; 508 508 } ··· 528 528 } 529 529 530 530 531 - private function getCustomCapabilitySpecification($capability) { 531 + final private function getCustomCapabilitySpecification($capability) { 532 532 $custom = $this->getCustomCapabilities(); 533 533 if (!isset($custom[$capability])) { 534 534 throw new Exception(pht("Unknown capability '%s'!", $capability)); ··· 536 536 return $custom[$capability]; 537 537 } 538 538 539 - public function getCapabilityLabel($capability) { 539 + final public function getCapabilityLabel($capability) { 540 540 switch ($capability) { 541 541 case PhabricatorPolicyCapability::CAN_VIEW: 542 542 return pht('Can Use Application'); ··· 552 552 return null; 553 553 } 554 554 555 - public function isCapabilityEditable($capability) { 555 + final public function isCapabilityEditable($capability) { 556 556 switch ($capability) { 557 557 case PhabricatorPolicyCapability::CAN_VIEW: 558 558 return $this->canUninstall(); ··· 564 564 } 565 565 } 566 566 567 - public function getCapabilityCaption($capability) { 567 + final public function getCapabilityCaption($capability) { 568 568 switch ($capability) { 569 569 case PhabricatorPolicyCapability::CAN_VIEW: 570 570 if (!$this->canUninstall()) { ··· 582 582 } 583 583 } 584 584 585 - public function getCapabilityTemplatePHIDType($capability) { 585 + final public function getCapabilityTemplatePHIDType($capability) { 586 586 switch ($capability) { 587 587 case PhabricatorPolicyCapability::CAN_VIEW: 588 588 case PhabricatorPolicyCapability::CAN_EDIT: