From 00400ae6f96583ef150c39acd53dc35f377d05c5 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 22 May 2017 18:59:53 +0000 Subject: [PATCH] Search and Replace calls to setShade Summary: grep for setShade and update to setColor. Add deprecated warning. Test Plan: Diffusion, Workboards, Maniphest, Project tags, tokenizer, uiexamples Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, O14 ATC Monitoring Differential Revision: https://secure.phabricator.com/D17995 --- .../calendar/view/PHUIUserAvailabilityView.php | 2 +- .../conpherence/controller/ConpherenceController.php | 2 +- .../differential/constants/DifferentialRevisionStatus.php | 2 +- .../files/controller/PhabricatorFileInfoController.php | 4 ++-- .../harbormaster/view/HarbormasterUnitSummaryView.php | 2 +- .../maniphest/constants/ManiphestTaskStatus.php | 2 +- .../PhabricatorOwnersHovercardEngineExtension.php | 2 +- src/applications/people/view/PhabricatorUserCardView.php | 2 +- .../controller/PhabricatorProjectBoardViewController.php | 2 +- .../project/query/PhabricatorProjectSearchEngine.php | 2 +- src/applications/project/view/ProjectBoardTaskCard.php | 2 +- .../search/query/PhabricatorFulltextToken.php | 2 +- src/applications/uiexample/examples/PHUITagExample.php | 4 ++-- .../diff/view/PHUIDiffInlineCommentDetailView.php | 4 ++-- .../markup/rule/PhabricatorNavigationRemarkupRule.php | 2 +- src/view/phui/PHUIHeaderView.php | 2 +- src/view/phui/PHUITagView.php | 8 +++++++- 17 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/applications/calendar/view/PHUIUserAvailabilityView.php b/src/applications/calendar/view/PHUIUserAvailabilityView.php index 7ab0ace77a..f4f9696ba9 100644 --- a/src/applications/calendar/view/PHUIUserAvailabilityView.php +++ b/src/applications/calendar/view/PHUIUserAvailabilityView.php @@ -29,7 +29,7 @@ final class PHUIUserAvailabilityView $away_tag = id(new PHUITagView()) ->setType(PHUITagView::TYPE_SHADE) - ->setShade($color) + ->setColor($color) ->setName($name) ->setDotColor($color); diff --git a/src/applications/conpherence/controller/ConpherenceController.php b/src/applications/conpherence/controller/ConpherenceController.php index 90328cca04..9d7473e159 100644 --- a/src/applications/conpherence/controller/ConpherenceController.php +++ b/src/applications/conpherence/controller/ConpherenceController.php @@ -71,7 +71,7 @@ abstract class ConpherenceController extends PhabricatorController { if (strlen($data['topic'])) { $topic = id(new PHUITagView()) ->setName($data['topic']) - ->setShade(PHUITagView::COLOR_VIOLET) + ->setColor(PHUITagView::COLOR_VIOLET) ->setType(PHUITagView::TYPE_SHADE) ->addClass('conpherence-header-topic'); $header->addTag($topic); diff --git a/src/applications/differential/constants/DifferentialRevisionStatus.php b/src/applications/differential/constants/DifferentialRevisionStatus.php index 4f332838ac..38e6a2dd49 100644 --- a/src/applications/differential/constants/DifferentialRevisionStatus.php +++ b/src/applications/differential/constants/DifferentialRevisionStatus.php @@ -65,7 +65,7 @@ final class DifferentialRevisionStatus extends Phobject { $tag = id(new PHUITagView()) ->setName($status_name) ->setIcon(self::getRevisionStatusIcon($status)) - ->setShade(self::getRevisionStatusColor($status)) + ->setColor(self::getRevisionStatusColor($status)) ->setType(PHUITagView::TYPE_SHADE); return $tag; diff --git a/src/applications/files/controller/PhabricatorFileInfoController.php b/src/applications/files/controller/PhabricatorFileInfoController.php index 061790aa31..f30421c132 100644 --- a/src/applications/files/controller/PhabricatorFileInfoController.php +++ b/src/applications/files/controller/PhabricatorFileInfoController.php @@ -44,7 +44,7 @@ final class PhabricatorFileInfoController extends PhabricatorFileController { if ($ttl !== null) { $ttl_tag = id(new PHUITagView()) ->setType(PHUITagView::TYPE_SHADE) - ->setShade(PHUITagView::COLOR_YELLOW) + ->setColor(PHUITagView::COLOR_YELLOW) ->setName(pht('Temporary')); $header->addTag($ttl_tag); } @@ -53,7 +53,7 @@ final class PhabricatorFileInfoController extends PhabricatorFileController { if ($partial) { $partial_tag = id(new PHUITagView()) ->setType(PHUITagView::TYPE_SHADE) - ->setShade(PHUITagView::COLOR_ORANGE) + ->setColor(PHUITagView::COLOR_ORANGE) ->setName(pht('Partial Upload')); $header->addTag($partial_tag); } diff --git a/src/applications/harbormaster/view/HarbormasterUnitSummaryView.php b/src/applications/harbormaster/view/HarbormasterUnitSummaryView.php index 28f79ee181..e5a66a3eb8 100644 --- a/src/applications/harbormaster/view/HarbormasterUnitSummaryView.php +++ b/src/applications/harbormaster/view/HarbormasterUnitSummaryView.php @@ -56,7 +56,7 @@ final class HarbormasterUnitSummaryView extends AphrontView { $tag = id(new PHUITagView()) ->setType(PHUITagView::TYPE_SHADE) - ->setShade($tag_color) + ->setColor($tag_color) ->setIcon($tag_icon) ->setName($tag_text); diff --git a/src/applications/maniphest/constants/ManiphestTaskStatus.php b/src/applications/maniphest/constants/ManiphestTaskStatus.php index 5734892f0a..6781fb7724 100644 --- a/src/applications/maniphest/constants/ManiphestTaskStatus.php +++ b/src/applications/maniphest/constants/ManiphestTaskStatus.php @@ -97,7 +97,7 @@ final class ManiphestTaskStatus extends ManiphestConstants { ->setName($name) ->setIcon($icon) ->setType(PHUITagView::TYPE_SHADE) - ->setShade($color); + ->setColor($color); return $tag; } diff --git a/src/applications/owners/engineextension/PhabricatorOwnersHovercardEngineExtension.php b/src/applications/owners/engineextension/PhabricatorOwnersHovercardEngineExtension.php index 744d3fbea2..39fe30ad28 100644 --- a/src/applications/owners/engineextension/PhabricatorOwnersHovercardEngineExtension.php +++ b/src/applications/owners/engineextension/PhabricatorOwnersHovercardEngineExtension.php @@ -64,7 +64,7 @@ final class PhabricatorOwnersHovercardEngineExtension if ($package->isArchived()) { $tag = id(new PHUITagView()) ->setName(pht('Archived')) - ->setShade(PHUITagView::COLOR_INDIGO) + ->setColor(PHUITagView::COLOR_INDIGO) ->setType(PHUITagView::TYPE_OBJECT); $hovercard->addTag($tag); } diff --git a/src/applications/people/view/PhabricatorUserCardView.php b/src/applications/people/view/PhabricatorUserCardView.php index 4f4f15a33d..f1fc515f88 100644 --- a/src/applications/people/view/PhabricatorUserCardView.php +++ b/src/applications/people/view/PhabricatorUserCardView.php @@ -85,7 +85,7 @@ final class PhabricatorUserCardView extends AphrontTagView { ->setType(PHUITagView::TYPE_SHADE); if ($tag_shade !== null) { - $tag->setShade($tag_shade); + $tag->setColor($tag_shade); } $body = array(); diff --git a/src/applications/project/controller/PhabricatorProjectBoardViewController.php b/src/applications/project/controller/PhabricatorProjectBoardViewController.php index 51b907cac0..ad08df1692 100644 --- a/src/applications/project/controller/PhabricatorProjectBoardViewController.php +++ b/src/applications/project/controller/PhabricatorProjectBoardViewController.php @@ -331,7 +331,7 @@ final class PhabricatorProjectBoardViewController $count_tag = id(new PHUITagView()) ->setType(PHUITagView::TYPE_SHADE) - ->setShade(PHUITagView::COLOR_BLUE) + ->setColor(PHUITagView::COLOR_BLUE) ->addSigil('column-points') ->setName( javelin_tag( diff --git a/src/applications/project/query/PhabricatorProjectSearchEngine.php b/src/applications/project/query/PhabricatorProjectSearchEngine.php index df13278812..452085fa9f 100644 --- a/src/applications/project/query/PhabricatorProjectSearchEngine.php +++ b/src/applications/project/query/PhabricatorProjectSearchEngine.php @@ -211,7 +211,7 @@ final class PhabricatorProjectSearchEngine $options[$color] = array( id(new PHUITagView()) ->setType(PHUITagView::TYPE_SHADE) - ->setShade($color) + ->setColor($color) ->setName($name), ); } diff --git a/src/applications/project/view/ProjectBoardTaskCard.php b/src/applications/project/view/ProjectBoardTaskCard.php index ba5213a623..100fee20b3 100644 --- a/src/applications/project/view/ProjectBoardTaskCard.php +++ b/src/applications/project/view/ProjectBoardTaskCard.php @@ -100,7 +100,7 @@ final class ProjectBoardTaskCard extends Phobject { if ($points !== null) { $points_tag = id(new PHUITagView()) ->setType(PHUITagView::TYPE_SHADE) - ->setShade(PHUITagView::COLOR_GREY) + ->setColor(PHUITagView::COLOR_GREY) ->setSlimShady(true) ->setName($points) ->addClass('phui-workcard-points'); diff --git a/src/applications/search/query/PhabricatorFulltextToken.php b/src/applications/search/query/PhabricatorFulltextToken.php index d42c15e9e6..4edeb098a9 100644 --- a/src/applications/search/query/PhabricatorFulltextToken.php +++ b/src/applications/search/query/PhabricatorFulltextToken.php @@ -64,7 +64,7 @@ final class PhabricatorFulltextToken extends Phobject { $tag = id(new PHUITagView()) ->setType(PHUITagView::TYPE_SHADE) - ->setShade($shade) + ->setColor($shade) ->setName($token->getValue()); if ($tip !== null) { diff --git a/src/applications/uiexample/examples/PHUITagExample.php b/src/applications/uiexample/examples/PHUITagExample.php index 764caaf717..027be2f9d8 100644 --- a/src/applications/uiexample/examples/PHUITagExample.php +++ b/src/applications/uiexample/examples/PHUITagExample.php @@ -187,12 +187,12 @@ final class PHUITagExample extends PhabricatorUIExample { foreach ($outlines as $outline) { $tags[] = id(new PHUITagView()) ->setType(PHUITagView::TYPE_OUTLINE) - ->setShade($outline) + ->setColor($outline) ->setName($outline); $tags[] = hsprintf(' '); $tags[] = id(new PHUITagView()) ->setType(PHUITagView::TYPE_OUTLINE) - ->setShade($outline) + ->setColor($outline) ->setSlimShady(true) ->setName($outline); $tags[] = hsprintf('

'); diff --git a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php index 821834431a..a42efa932a 100644 --- a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php +++ b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php @@ -148,7 +148,7 @@ final class PHUIDiffInlineCommentDetailView ->setType(PHUITagView::TYPE_SHADE) ->setName(pht('Unsubmitted')) ->setSlimShady(true) - ->setShade(PHUITagView::COLOR_RED) + ->setColor(PHUITagView::COLOR_RED) ->addClass('mml inline-draft-text'); } @@ -383,7 +383,7 @@ final class PHUIDiffInlineCommentDetailView ->setType(PHUITagView::TYPE_SHADE) ->setName(pht('Author')) ->setSlimShady(true) - ->setShade(PHUITagView::COLOR_YELLOW) + ->setColor(PHUITagView::COLOR_YELLOW) ->addClass('mml'); } } diff --git a/src/infrastructure/markup/rule/PhabricatorNavigationRemarkupRule.php b/src/infrastructure/markup/rule/PhabricatorNavigationRemarkupRule.php index 458ee5b834..3fc3373001 100644 --- a/src/infrastructure/markup/rule/PhabricatorNavigationRemarkupRule.php +++ b/src/infrastructure/markup/rule/PhabricatorNavigationRemarkupRule.php @@ -60,7 +60,7 @@ final class PhabricatorNavigationRemarkupRule extends PhutilRemarkupRule { $tag = id(new PHUITagView()) ->setType(PHUITagView::TYPE_SHADE) - ->setShade($item_color) + ->setColor($item_color) ->setName($item_name); if ($item['icon']) { diff --git a/src/view/phui/PHUIHeaderView.php b/src/view/phui/PHUIHeaderView.php index 0cd8379b42..ab576c64d5 100644 --- a/src/view/phui/PHUIHeaderView.php +++ b/src/view/phui/PHUIHeaderView.php @@ -131,7 +131,7 @@ final class PHUIHeaderView extends AphrontTagView { $tag = id(new PHUITagView()) ->setName($name) ->setIcon($icon) - ->setShade($color) + ->setColor($color) ->setType(PHUITagView::TYPE_SHADE); return $this->addProperty(self::PROPERTY_STATUS, $tag); diff --git a/src/view/phui/PHUITagView.php b/src/view/phui/PHUITagView.php index e8d30e935e..1811f8f1a9 100644 --- a/src/view/phui/PHUITagView.php +++ b/src/view/phui/PHUITagView.php @@ -57,8 +57,14 @@ final class PHUITagView extends AphrontTagView { return $this; } - /* Deprecated, use setColor */ + /** + * This method has been deprecated, use @{method:setColor} instead. + * + * @deprecated + */ public function setShade($shade) { + phlog( + pht('Deprecated call to setShade(), use setColor() instead.')); $this->color = $shade; return $this; }