From 48f1a578f8804da3496dae090e715293ca926719 Mon Sep 17 00:00:00 2001 From: Anh Nhan Nguyen Date: Mon, 1 Apr 2013 06:18:44 -0700 Subject: [PATCH] Adding some type names to object handles Summary: I browsed through the applications and searched for all flaggable objects and gave them names. Only flaggable ones, since they were the only ones I deemed important for my future diff(s). Also, I thought that this method may be deprecated in some way, since it only included some older applications Also adding proper fallback. Without makes my future diff(s) non-fatal in a user-confusing way (imagine you are displaying the object type ## ## (`null` ^^)) Also usable for Refs T1048 Test Plan: Used in a future diff, names appear, fallback works as expected. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T1048 Differential Revision: https://secure.phabricator.com/D5514 --- src/applications/phid/PhabricatorObjectHandle.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/applications/phid/PhabricatorObjectHandle.php b/src/applications/phid/PhabricatorObjectHandle.php index 03ccf8ca60..7814b76bcc 100644 --- a/src/applications/phid/PhabricatorObjectHandle.php +++ b/src/applications/phid/PhabricatorObjectHandle.php @@ -111,10 +111,18 @@ final class PhabricatorObjectHandle { PhabricatorPHIDConstants::PHID_TYPE_TASK => 'Task', PhabricatorPHIDConstants::PHID_TYPE_DREV => 'Revision', PhabricatorPHIDConstants::PHID_TYPE_CMIT => 'Commit', - PhabricatorPHIDConstants::PHID_TYPE_WIKI => 'Phriction', + PhabricatorPHIDConstants::PHID_TYPE_WIKI => 'Phriction Document', + PhabricatorPHIDConstants::PHID_TYPE_MCRO => 'Image Macro', + PhabricatorPHIDConstants::PHID_TYPE_MOCK => 'Pholio Mock', + PhabricatorPHIDConstants::PHID_TYPE_FILE => 'File', + PhabricatorPHIDConstants::PHID_TYPE_BLOG => 'Blog', + PhabricatorPHIDConstants::PHID_TYPE_POST => 'Post', + PhabricatorPHIDConstants::PHID_TYPE_QUES => 'Question', + PhabricatorPHIDConstants::PHID_TYPE_PVAR => 'Variable', + PhabricatorPHIDConstants::PHID_TYPE_PSTE => 'Paste', ); - return idx($map, $this->getType()); + return idx($map, $this->getType(), $this->getType()); }