mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-20 11:41:08 +01:00
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
This commit is contained in:
parent
e81bad9ba2
commit
1975bdfb36
4 changed files with 12 additions and 5 deletions
|
@ -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',
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
|
||||
interface PhabricatorFlaggableInterface {
|
||||
|
||||
public function getPHID();
|
||||
interface PhabricatorFlaggableInterface extends PhabricatorPHIDInterface {
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
interface PhabricatorPHIDInterface {
|
||||
|
||||
public function getPHID();
|
||||
|
||||
}
|
|
@ -1,8 +1,7 @@
|
|||
<?php
|
||||
|
||||
interface PhabricatorPolicyInterface {
|
||||
interface PhabricatorPolicyInterface extends PhabricatorPHIDInterface {
|
||||
|
||||
public function getPHID();
|
||||
public function getCapabilities();
|
||||
public function getPolicy($capability);
|
||||
public function hasAutomaticCapability($capability, PhabricatorUser $viewer);
|
||||
|
|
Loading…
Reference in a new issue