From 1975bdfb3660bc6dea6a2537978f94e7b511f640 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 25 Oct 2013 15:58:17 -0700 Subject: [PATCH] Work around a bug in PHP 5.3-ish with abstract methods in interfaces Summary: @chad is hitting an issue described in P961, which I think is this bug in PHP: https://bugs.php.net/bug.php?id=43200 Work around it by defining a "PHIDInterface" and having both "Flaggable" and "Policy" extend it, so that there is only one `getPHID()` declaration. Test Plan: shrug~ Reviewers: chad, btrahan Reviewed By: chad CC: chad, aran Differential Revision: https://secure.phabricator.com/D7408 --- src/__phutil_library_map__.php | 3 +++ .../flag/interface/PhabricatorFlaggableInterface.php | 4 +--- .../phid/interface/PhabricatorPHIDInterface.php | 7 +++++++ .../policy/interface/PhabricatorPolicyInterface.php | 3 +-- 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 src/applications/phid/interface/PhabricatorPHIDInterface.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index f69a76d94f..9f85b1f934 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1485,6 +1485,7 @@ phutil_register_library_map(array( 'PhabricatorPHDConfigOptions' => 'applications/config/option/PhabricatorPHDConfigOptions.php', 'PhabricatorPHID' => 'applications/phid/storage/PhabricatorPHID.php', 'PhabricatorPHIDConstants' => 'applications/phid/PhabricatorPHIDConstants.php', + 'PhabricatorPHIDInterface' => 'applications/phid/interface/PhabricatorPHIDInterface.php', 'PhabricatorPHIDType' => 'applications/phid/type/PhabricatorPHIDType.php', 'PhabricatorPHPMailerConfigOptions' => 'applications/config/option/PhabricatorPHPMailerConfigOptions.php', 'PhabricatorPagedFormExample' => 'applications/uiexample/examples/PhabricatorPagedFormExample.php', @@ -3594,6 +3595,7 @@ phutil_register_library_map(array( 'PhabricatorFlagQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorFlagSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhabricatorFlagSelectControl' => 'AphrontFormControl', + 'PhabricatorFlaggableInterface' => 'PhabricatorPHIDInterface', 'PhabricatorFlagsUIEventListener' => 'PhabricatorEventListener', 'PhabricatorFormExample' => 'PhabricatorUIExample', 'PhabricatorGarbageCollectorConfigOptions' => 'PhabricatorApplicationConfigOptions', @@ -3844,6 +3846,7 @@ phutil_register_library_map(array( 'PhabricatorPolicyEditController' => 'PhabricatorPolicyController', 'PhabricatorPolicyException' => 'Exception', 'PhabricatorPolicyExplainController' => 'PhabricatorPolicyController', + 'PhabricatorPolicyInterface' => 'PhabricatorPHIDInterface', 'PhabricatorPolicyManagementShowWorkflow' => 'PhabricatorPolicyManagementWorkflow', 'PhabricatorPolicyManagementUnlockWorkflow' => 'PhabricatorPolicyManagementWorkflow', 'PhabricatorPolicyManagementWorkflow' => 'PhutilArgumentWorkflow', diff --git a/src/applications/flag/interface/PhabricatorFlaggableInterface.php b/src/applications/flag/interface/PhabricatorFlaggableInterface.php index 66bd954b55..5d10ea276c 100644 --- a/src/applications/flag/interface/PhabricatorFlaggableInterface.php +++ b/src/applications/flag/interface/PhabricatorFlaggableInterface.php @@ -1,7 +1,5 @@