Page MenuHomePhabricator

D7306.diff

diff --git a/src/applications/conduit/method/ConduitAPIMethod.php b/src/applications/conduit/method/ConduitAPIMethod.php
--- a/src/applications/conduit/method/ConduitAPIMethod.php
+++ b/src/applications/conduit/method/ConduitAPIMethod.php
@@ -25,7 +25,7 @@
/**
* This is mostly for compatibility with
- * @{class:AphrontCursorPagedPolicyAwareQuery}.
+ * @{class:PhabricatorCursorPagedPolicyAwareQuery}.
*/
public function getID() {
return $this->getAPIMethodName();
@@ -166,6 +166,10 @@
/* -( PhabricatorPolicyInterface )----------------------------------------- */
+ public function getPHID() {
+ return null;
+ }
+
public function getCapabilities() {
return array(
PhabricatorPolicyCapability::CAN_VIEW,
diff --git a/src/applications/config/storage/PhabricatorConfigEntry.php b/src/applications/config/storage/PhabricatorConfigEntry.php
--- a/src/applications/config/storage/PhabricatorConfigEntry.php
+++ b/src/applications/config/storage/PhabricatorConfigEntry.php
@@ -3,8 +3,6 @@
final class PhabricatorConfigEntry extends PhabricatorConfigEntryDAO
implements PhabricatorPolicyInterface {
- protected $id;
- protected $phid;
protected $namespace;
protected $configKey;
protected $value;
diff --git a/src/applications/conpherence/storage/ConpherenceThread.php b/src/applications/conpherence/storage/ConpherenceThread.php
--- a/src/applications/conpherence/storage/ConpherenceThread.php
+++ b/src/applications/conpherence/storage/ConpherenceThread.php
@@ -6,8 +6,6 @@
final class ConpherenceThread extends ConpherenceDAO
implements PhabricatorPolicyInterface {
- protected $id;
- protected $phid;
protected $title;
protected $messageCount;
protected $recentParticipantPHIDs = array();
diff --git a/src/applications/countdown/storage/PhabricatorCountdown.php b/src/applications/countdown/storage/PhabricatorCountdown.php
--- a/src/applications/countdown/storage/PhabricatorCountdown.php
+++ b/src/applications/countdown/storage/PhabricatorCountdown.php
@@ -7,8 +7,6 @@
extends PhabricatorCountdownDAO
implements PhabricatorPolicyInterface {
- protected $id;
- protected $phid;
protected $title;
protected $authorPHID;
protected $epoch;
diff --git a/src/applications/daemon/storage/PhabricatorDaemonLog.php b/src/applications/daemon/storage/PhabricatorDaemonLog.php
--- a/src/applications/daemon/storage/PhabricatorDaemonLog.php
+++ b/src/applications/daemon/storage/PhabricatorDaemonLog.php
@@ -26,6 +26,9 @@
/* -( PhabricatorPolicyInterface )----------------------------------------- */
+ public function getPHID() {
+ return null;
+ }
public function getCapabilities() {
return array(
diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php
--- a/src/applications/differential/storage/DifferentialRevision.php
+++ b/src/applications/differential/storage/DifferentialRevision.php
@@ -13,7 +13,6 @@
protected $summary = '';
protected $testPlan = '';
- protected $phid;
protected $authorPHID;
protected $lastReviewerPHID;
diff --git a/src/applications/diviner/storage/DivinerLiveBook.php b/src/applications/diviner/storage/DivinerLiveBook.php
--- a/src/applications/diviner/storage/DivinerLiveBook.php
+++ b/src/applications/diviner/storage/DivinerLiveBook.php
@@ -3,7 +3,6 @@
final class DivinerLiveBook extends DivinerDAO
implements PhabricatorPolicyInterface {
- protected $phid;
protected $name;
protected $viewPolicy;
protected $configurationData = array();
diff --git a/src/applications/diviner/storage/DivinerLiveSymbol.php b/src/applications/diviner/storage/DivinerLiveSymbol.php
--- a/src/applications/diviner/storage/DivinerLiveSymbol.php
+++ b/src/applications/diviner/storage/DivinerLiveSymbol.php
@@ -3,7 +3,6 @@
final class DivinerLiveSymbol extends DivinerDAO
implements PhabricatorPolicyInterface, PhabricatorMarkupInterface {
- protected $phid;
protected $bookPHID;
protected $context;
protected $type;
diff --git a/src/applications/feed/story/PhabricatorFeedStory.php b/src/applications/feed/story/PhabricatorFeedStory.php
--- a/src/applications/feed/story/PhabricatorFeedStory.php
+++ b/src/applications/feed/story/PhabricatorFeedStory.php
@@ -283,6 +283,9 @@
/* -( PhabricatorPolicyInterface Implementation )-------------------------- */
+ public function getPHID() {
+ return null;
+ }
/**
* @task policy
diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php
--- a/src/applications/files/storage/PhabricatorFile.php
+++ b/src/applications/files/storage/PhabricatorFile.php
@@ -14,7 +14,6 @@
const METADATA_IMAGE_WIDTH = 'width';
const METADATA_IMAGE_HEIGHT = 'height';
- protected $phid;
protected $name;
protected $mimeType;
protected $byteSize;
diff --git a/src/applications/herald/storage/transcript/HeraldTranscript.php b/src/applications/herald/storage/transcript/HeraldTranscript.php
--- a/src/applications/herald/storage/transcript/HeraldTranscript.php
+++ b/src/applications/herald/storage/transcript/HeraldTranscript.php
@@ -3,9 +3,6 @@
final class HeraldTranscript extends HeraldDAO
implements PhabricatorPolicyInterface {
- protected $id;
- protected $phid;
-
protected $objectTranscript;
protected $ruleTranscripts = array();
protected $conditionTranscripts = array();
diff --git a/src/applications/legalpad/storage/LegalpadDocument.php b/src/applications/legalpad/storage/LegalpadDocument.php
--- a/src/applications/legalpad/storage/LegalpadDocument.php
+++ b/src/applications/legalpad/storage/LegalpadDocument.php
@@ -9,7 +9,6 @@
PhabricatorSubscribableInterface,
PhabricatorApplicationTransactionInterface {
- protected $phid;
protected $title;
protected $contributorCount;
protected $recentContributorPHIDs = array();
diff --git a/src/applications/macro/storage/PhabricatorFileImageMacro.php b/src/applications/macro/storage/PhabricatorFileImageMacro.php
--- a/src/applications/macro/storage/PhabricatorFileImageMacro.php
+++ b/src/applications/macro/storage/PhabricatorFileImageMacro.php
@@ -8,7 +8,6 @@
protected $authorPHID;
protected $filePHID;
- protected $phid;
protected $name;
protected $isDisabled = 0;
protected $audioPHID;
diff --git a/src/applications/mailinglists/storage/PhabricatorMetaMTAMailingList.php b/src/applications/mailinglists/storage/PhabricatorMetaMTAMailingList.php
--- a/src/applications/mailinglists/storage/PhabricatorMetaMTAMailingList.php
+++ b/src/applications/mailinglists/storage/PhabricatorMetaMTAMailingList.php
@@ -4,7 +4,6 @@
implements PhabricatorPolicyInterface {
protected $name;
- protected $phid;
protected $email;
protected $uri;
diff --git a/src/applications/maniphest/storage/ManiphestTask.php b/src/applications/maniphest/storage/ManiphestTask.php
--- a/src/applications/maniphest/storage/ManiphestTask.php
+++ b/src/applications/maniphest/storage/ManiphestTask.php
@@ -10,7 +10,6 @@
const MARKUP_FIELD_DESCRIPTION = 'markup:desc';
- protected $phid;
protected $authorPHID;
protected $ownerPHID;
protected $ccPHIDs = array();
diff --git a/src/applications/owners/storage/PhabricatorOwnersPackage.php b/src/applications/owners/storage/PhabricatorOwnersPackage.php
--- a/src/applications/owners/storage/PhabricatorOwnersPackage.php
+++ b/src/applications/owners/storage/PhabricatorOwnersPackage.php
@@ -3,7 +3,6 @@
final class PhabricatorOwnersPackage extends PhabricatorOwnersDAO
implements PhabricatorPolicyInterface {
- protected $phid;
protected $name;
protected $originalName;
protected $auditingEnabled;
diff --git a/src/applications/paste/storage/PhabricatorPaste.php b/src/applications/paste/storage/PhabricatorPaste.php
--- a/src/applications/paste/storage/PhabricatorPaste.php
+++ b/src/applications/paste/storage/PhabricatorPaste.php
@@ -9,7 +9,6 @@
PhabricatorTokenReceiverInterface,
PhabricatorPolicyInterface {
- protected $phid;
protected $title;
protected $authorPHID;
protected $filePHID;
diff --git a/src/applications/people/storage/PhabricatorUser.php b/src/applications/people/storage/PhabricatorUser.php
--- a/src/applications/people/storage/PhabricatorUser.php
+++ b/src/applications/people/storage/PhabricatorUser.php
@@ -11,7 +11,6 @@
const NAMETOKEN_TABLE = 'user_nametoken';
const MAXIMUM_USERNAME_LENGTH = 64;
- protected $phid;
protected $userName;
protected $realName;
protected $sex;
diff --git a/src/applications/phame/storage/PhameBlog.php b/src/applications/phame/storage/PhameBlog.php
--- a/src/applications/phame/storage/PhameBlog.php
+++ b/src/applications/phame/storage/PhameBlog.php
@@ -10,8 +10,6 @@
const SKIN_DEFAULT = 'oblivious';
- protected $id;
- protected $phid;
protected $name;
protected $description;
protected $domain;
diff --git a/src/applications/phame/storage/PhamePost.php b/src/applications/phame/storage/PhamePost.php
--- a/src/applications/phame/storage/PhamePost.php
+++ b/src/applications/phame/storage/PhamePost.php
@@ -15,8 +15,6 @@
const VISIBILITY_DRAFT = 0;
const VISIBILITY_PUBLISHED = 1;
- protected $id;
- protected $phid;
protected $bloggerPHID;
protected $title;
protected $phameTitle;
diff --git a/src/applications/phriction/storage/PhrictionDocument.php b/src/applications/phriction/storage/PhrictionDocument.php
--- a/src/applications/phriction/storage/PhrictionDocument.php
+++ b/src/applications/phriction/storage/PhrictionDocument.php
@@ -9,8 +9,6 @@
PhabricatorSubscribableInterface,
PhabricatorTokenReceiverInterface {
- protected $id;
- protected $phid;
protected $slug;
protected $depth;
protected $contentID;
diff --git a/src/applications/policy/__tests__/PhabricatorPolicyTestObject.php b/src/applications/policy/__tests__/PhabricatorPolicyTestObject.php
--- a/src/applications/policy/__tests__/PhabricatorPolicyTestObject.php
+++ b/src/applications/policy/__tests__/PhabricatorPolicyTestObject.php
@@ -10,6 +10,10 @@
private $policies = array();
private $automaticCapabilities = array();
+ public function getPHID() {
+ return null;
+ }
+
public function getCapabilities() {
return $this->capabilities;
}
diff --git a/src/applications/policy/filter/PhabricatorPolicyFilter.php b/src/applications/policy/filter/PhabricatorPolicyFilter.php
--- a/src/applications/policy/filter/PhabricatorPolicyFilter.php
+++ b/src/applications/policy/filter/PhabricatorPolicyFilter.php
@@ -282,19 +282,9 @@
$details = array_filter(array_merge(array($more), (array)$exceptions));
- // NOTE: Not every policy object has a PHID, just pull an arbitrary
- // "unknown object" handle if this fails. We're just using this to provide
- // a better error message if we can.
-
- $phid = '?';
- if (($object instanceof PhabricatorLiskDAO) ||
- (method_exists($object, 'getPHID'))) {
- try {
- $phid = $object->getPHID();
- } catch (Exception $ignored) {
- // Ignore.
- }
- }
+ // NOTE: Not every type of policy object has a real PHID; just load an
+ // empty handle if a real PHID isn't available.
+ $phid = nonempty($object->getPHID(), PhabricatorPHIDConstants::PHID_VOID);
$handle = id(new PhabricatorHandleQuery())
->setViewer($this->viewer)
diff --git a/src/applications/policy/interface/PhabricatorPolicyInterface.php b/src/applications/policy/interface/PhabricatorPolicyInterface.php
--- a/src/applications/policy/interface/PhabricatorPolicyInterface.php
+++ b/src/applications/policy/interface/PhabricatorPolicyInterface.php
@@ -2,6 +2,7 @@
interface PhabricatorPolicyInterface {
+ public function getPHID();
public function getCapabilities();
public function getPolicy($capability);
public function hasAutomaticCapability($capability, PhabricatorUser $viewer);
diff --git a/src/applications/project/storage/PhabricatorProject.php b/src/applications/project/storage/PhabricatorProject.php
--- a/src/applications/project/storage/PhabricatorProject.php
+++ b/src/applications/project/storage/PhabricatorProject.php
@@ -4,7 +4,6 @@
implements PhabricatorPolicyInterface {
protected $name;
- protected $phid;
protected $status = PhabricatorProjectStatus::STATUS_ACTIVE;
protected $authorPHID;
protected $subprojectPHIDs = array();
diff --git a/src/applications/releeph/storage/ReleephBranch.php b/src/applications/releeph/storage/ReleephBranch.php
--- a/src/applications/releeph/storage/ReleephBranch.php
+++ b/src/applications/releeph/storage/ReleephBranch.php
@@ -3,7 +3,6 @@
final class ReleephBranch extends ReleephDAO
implements PhabricatorPolicyInterface {
- protected $phid;
protected $releephProjectID;
protected $isActive;
protected $createdByUserPHID;
diff --git a/src/applications/releeph/storage/ReleephProject.php b/src/applications/releeph/storage/ReleephProject.php
--- a/src/applications/releeph/storage/ReleephProject.php
+++ b/src/applications/releeph/storage/ReleephProject.php
@@ -10,7 +10,6 @@
const COMMIT_AUTHOR_FROM_DIFF = 'commit-author-is-from-diff';
const COMMIT_AUTHOR_REQUESTOR = 'commit-author-is-requestor';
- protected $phid;
protected $name;
// Specifying the place to pick from is a requirement for svn, though not
diff --git a/src/applications/releeph/storage/ReleephRequest.php b/src/applications/releeph/storage/ReleephRequest.php
--- a/src/applications/releeph/storage/ReleephRequest.php
+++ b/src/applications/releeph/storage/ReleephRequest.php
@@ -5,7 +5,6 @@
PhabricatorPolicyInterface,
PhabricatorCustomFieldInterface {
- protected $phid;
protected $branchID;
protected $requestUserPHID;
protected $details = array();
diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php
--- a/src/applications/repository/storage/PhabricatorRepository.php
+++ b/src/applications/repository/storage/PhabricatorRepository.php
@@ -25,7 +25,6 @@
const TABLE_BADCOMMIT = 'repository_badcommit';
const TABLE_LINTMESSAGE = 'repository_lintmessage';
- protected $phid;
protected $name;
protected $callsign;
protected $uuid;
diff --git a/src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php b/src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php
--- a/src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php
+++ b/src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php
@@ -8,7 +8,6 @@
implements PhabricatorPolicyInterface {
protected $name;
- protected $phid;
protected $repositoryID;
protected $symbolIndexLanguages = array();
diff --git a/src/infrastructure/storage/lisk/LiskDAO.php b/src/infrastructure/storage/lisk/LiskDAO.php
--- a/src/infrastructure/storage/lisk/LiskDAO.php
+++ b/src/infrastructure/storage/lisk/LiskDAO.php
@@ -892,6 +892,11 @@
}
+ public function getPHID() {
+ return $this->phid;
+ }
+
+
/**
* Test if a property exists.
*

File Metadata

Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/de/hn/pyiixjmey7nh6nib
Default Alt Text
D7306.diff (14 KB)

Event Timeline