From 9502312b60aef9b377bf3318f25ead995a483f05 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 3 Feb 2021 14:10:21 -0800 Subject: [PATCH] Remove "final" from "private" methods in Phabricator Summary: Ref T13588. This has never been meaningful, but a "final private" method is specifically forbidden in PHP8. Remove meaningless "final" from these methods, per new lint checks. Test Plan: Ran `arc lint --everything` to identify affected methods, then `... | xargs -n1 arc lint --apply-patches`. Maniphest Tasks: T13588 Differential Revision: https://secure.phabricator.com/D21540 --- src/applications/base/PhabricatorApplication.php | 4 ++-- .../differential/storage/DifferentialHunk.php | 2 +- .../diffusion/request/DiffusionRequest.php | 8 ++++---- .../PhabricatorApplicationTransactionEditor.php | 8 ++++---- .../PhabricatorCursorPagedPolicyAwareQuery.php | 12 ++++++------ .../PhabricatorStorageManagementWorkflow.php | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/applications/base/PhabricatorApplication.php b/src/applications/base/PhabricatorApplication.php index 9526fb1442..407f3171c0 100644 --- a/src/applications/base/PhabricatorApplication.php +++ b/src/applications/base/PhabricatorApplication.php @@ -490,7 +490,7 @@ abstract class PhabricatorApplication return array(); } - final private function getCustomPolicySetting($capability) { + private function getCustomPolicySetting($capability) { if (!$this->isCapabilityEditable($capability)) { return null; } @@ -516,7 +516,7 @@ abstract class PhabricatorApplication } - final private function getCustomCapabilitySpecification($capability) { + private function getCustomCapabilitySpecification($capability) { $custom = $this->getCustomCapabilities(); if (!isset($custom[$capability])) { throw new Exception(pht("Unknown capability '%s'!", $capability)); diff --git a/src/applications/differential/storage/DifferentialHunk.php b/src/applications/differential/storage/DifferentialHunk.php index 6bfb38b789..f7decf69ae 100644 --- a/src/applications/differential/storage/DifferentialHunk.php +++ b/src/applications/differential/storage/DifferentialHunk.php @@ -203,7 +203,7 @@ final class DifferentialHunk return implode('', $this->makeContent($include)); } - final private function makeContent($include) { + private function makeContent($include) { $lines = $this->getSplitLines(); $results = array(); diff --git a/src/applications/diffusion/request/DiffusionRequest.php b/src/applications/diffusion/request/DiffusionRequest.php index d866874f5d..49ea305908 100644 --- a/src/applications/diffusion/request/DiffusionRequest.php +++ b/src/applications/diffusion/request/DiffusionRequest.php @@ -125,7 +125,7 @@ abstract class DiffusionRequest extends Phobject { * * @task new */ - final private function __construct() { + private function __construct() { // } @@ -138,7 +138,7 @@ abstract class DiffusionRequest extends Phobject { * @return DiffusionRequest New request object. * @task new */ - final private static function newFromIdentifier( + private static function newFromIdentifier( $identifier, PhabricatorUser $viewer, $need_edit = false) { @@ -174,7 +174,7 @@ abstract class DiffusionRequest extends Phobject { * @return DiffusionRequest New request object. * @task new */ - final private static function newFromRepository( + private static function newFromRepository( PhabricatorRepository $repository) { $map = array( @@ -205,7 +205,7 @@ abstract class DiffusionRequest extends Phobject { * @return void * @task new */ - final private function initializeFromDictionary(array $data) { + private function initializeFromDictionary(array $data) { $blob = idx($data, 'blob'); if (strlen($blob)) { $blob = self::parseRequestBlob($blob, $this->supportsBranches()); diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php index 0c5e642e30..437a7a1437 100644 --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php @@ -1389,7 +1389,7 @@ abstract class PhabricatorApplicationTransactionEditor return $xactions; } - final private function queuePublishing() { + private function queuePublishing() { $object = $this->publishableObject; $xactions = $this->publishableTransactions; @@ -4207,7 +4207,7 @@ abstract class PhabricatorApplicationTransactionEditor * @return dict Serializable editor state. * @task workers */ - final private function getWorkerState() { + private function getWorkerState() { $state = array(); foreach ($this->getAutomaticStateProperties() as $property) { $state[$property] = $this->$property; @@ -4336,7 +4336,7 @@ abstract class PhabricatorApplicationTransactionEditor * @return map Map of encoded values. * @task workers */ - final private function encodeStateForStorage( + private function encodeStateForStorage( array $state, array $encodings) { @@ -4382,7 +4382,7 @@ abstract class PhabricatorApplicationTransactionEditor * @return map Map of decoded values. * @task workers */ - final private function decodeStateFromStorage( + private function decodeStateFromStorage( array $state, array $encodings) { diff --git a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php index cb3a62c6ab..34a8e1813c 100644 --- a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php +++ b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php @@ -135,7 +135,7 @@ abstract class PhabricatorCursorPagedPolicyAwareQuery ); } - final private function getExternalCursorStringForResult($object) { + private function getExternalCursorStringForResult($object) { $cursor = $this->newExternalCursorStringForResult($object); if (!is_string($cursor)) { @@ -154,7 +154,7 @@ abstract class PhabricatorCursorPagedPolicyAwareQuery return $this->externalCursorString; } - final private function setExternalCursorString($external_cursor) { + private function setExternalCursorString($external_cursor) { $this->externalCursorString = $external_cursor; return $this; } @@ -168,17 +168,17 @@ abstract class PhabricatorCursorPagedPolicyAwareQuery return $this; } - final private function getInternalCursorObject() { + private function getInternalCursorObject() { return $this->internalCursorObject; } - final private function setInternalCursorObject( + private function setInternalCursorObject( PhabricatorQueryCursor $cursor) { $this->internalCursorObject = $cursor; return $this; } - final private function getInternalCursorFromExternalCursor( + private function getInternalCursorFromExternalCursor( $cursor_string) { $cursor_object = $this->newInternalCursorFromExternalCursor($cursor_string); @@ -196,7 +196,7 @@ abstract class PhabricatorCursorPagedPolicyAwareQuery return $cursor_object; } - final private function getPagingMapFromCursorObject( + private function getPagingMapFromCursorObject( PhabricatorQueryCursor $cursor, array $keys) { diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php index cc2073d8c9..490036e36d 100644 --- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php +++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php @@ -156,7 +156,7 @@ abstract class PhabricatorStorageManagementWorkflow return $err; } - final private function doAdjustSchemata( + private function doAdjustSchemata( PhabricatorStorageManagementAPI $api, $unsafe) { @@ -913,7 +913,7 @@ abstract class PhabricatorStorageManagementWorkflow } } - final private function doUpgradeSchemata( + private function doUpgradeSchemata( array $apis, $apply_only, $no_quickstart,