1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 16:52:41 +01:00

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
This commit is contained in:
Chad Little 2017-05-22 18:59:53 +00:00 committed by chad
parent 3a0a086a09
commit 00400ae6f9
17 changed files with 26 additions and 20 deletions

View file

@ -29,7 +29,7 @@ final class PHUIUserAvailabilityView
$away_tag = id(new PHUITagView()) $away_tag = id(new PHUITagView())
->setType(PHUITagView::TYPE_SHADE) ->setType(PHUITagView::TYPE_SHADE)
->setShade($color) ->setColor($color)
->setName($name) ->setName($name)
->setDotColor($color); ->setDotColor($color);

View file

@ -71,7 +71,7 @@ abstract class ConpherenceController extends PhabricatorController {
if (strlen($data['topic'])) { if (strlen($data['topic'])) {
$topic = id(new PHUITagView()) $topic = id(new PHUITagView())
->setName($data['topic']) ->setName($data['topic'])
->setShade(PHUITagView::COLOR_VIOLET) ->setColor(PHUITagView::COLOR_VIOLET)
->setType(PHUITagView::TYPE_SHADE) ->setType(PHUITagView::TYPE_SHADE)
->addClass('conpherence-header-topic'); ->addClass('conpherence-header-topic');
$header->addTag($topic); $header->addTag($topic);

View file

@ -65,7 +65,7 @@ final class DifferentialRevisionStatus extends Phobject {
$tag = id(new PHUITagView()) $tag = id(new PHUITagView())
->setName($status_name) ->setName($status_name)
->setIcon(self::getRevisionStatusIcon($status)) ->setIcon(self::getRevisionStatusIcon($status))
->setShade(self::getRevisionStatusColor($status)) ->setColor(self::getRevisionStatusColor($status))
->setType(PHUITagView::TYPE_SHADE); ->setType(PHUITagView::TYPE_SHADE);
return $tag; return $tag;

View file

@ -44,7 +44,7 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
if ($ttl !== null) { if ($ttl !== null) {
$ttl_tag = id(new PHUITagView()) $ttl_tag = id(new PHUITagView())
->setType(PHUITagView::TYPE_SHADE) ->setType(PHUITagView::TYPE_SHADE)
->setShade(PHUITagView::COLOR_YELLOW) ->setColor(PHUITagView::COLOR_YELLOW)
->setName(pht('Temporary')); ->setName(pht('Temporary'));
$header->addTag($ttl_tag); $header->addTag($ttl_tag);
} }
@ -53,7 +53,7 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
if ($partial) { if ($partial) {
$partial_tag = id(new PHUITagView()) $partial_tag = id(new PHUITagView())
->setType(PHUITagView::TYPE_SHADE) ->setType(PHUITagView::TYPE_SHADE)
->setShade(PHUITagView::COLOR_ORANGE) ->setColor(PHUITagView::COLOR_ORANGE)
->setName(pht('Partial Upload')); ->setName(pht('Partial Upload'));
$header->addTag($partial_tag); $header->addTag($partial_tag);
} }

View file

@ -56,7 +56,7 @@ final class HarbormasterUnitSummaryView extends AphrontView {
$tag = id(new PHUITagView()) $tag = id(new PHUITagView())
->setType(PHUITagView::TYPE_SHADE) ->setType(PHUITagView::TYPE_SHADE)
->setShade($tag_color) ->setColor($tag_color)
->setIcon($tag_icon) ->setIcon($tag_icon)
->setName($tag_text); ->setName($tag_text);

View file

@ -97,7 +97,7 @@ final class ManiphestTaskStatus extends ManiphestConstants {
->setName($name) ->setName($name)
->setIcon($icon) ->setIcon($icon)
->setType(PHUITagView::TYPE_SHADE) ->setType(PHUITagView::TYPE_SHADE)
->setShade($color); ->setColor($color);
return $tag; return $tag;
} }

View file

@ -64,7 +64,7 @@ final class PhabricatorOwnersHovercardEngineExtension
if ($package->isArchived()) { if ($package->isArchived()) {
$tag = id(new PHUITagView()) $tag = id(new PHUITagView())
->setName(pht('Archived')) ->setName(pht('Archived'))
->setShade(PHUITagView::COLOR_INDIGO) ->setColor(PHUITagView::COLOR_INDIGO)
->setType(PHUITagView::TYPE_OBJECT); ->setType(PHUITagView::TYPE_OBJECT);
$hovercard->addTag($tag); $hovercard->addTag($tag);
} }

View file

@ -85,7 +85,7 @@ final class PhabricatorUserCardView extends AphrontTagView {
->setType(PHUITagView::TYPE_SHADE); ->setType(PHUITagView::TYPE_SHADE);
if ($tag_shade !== null) { if ($tag_shade !== null) {
$tag->setShade($tag_shade); $tag->setColor($tag_shade);
} }
$body = array(); $body = array();

View file

@ -331,7 +331,7 @@ final class PhabricatorProjectBoardViewController
$count_tag = id(new PHUITagView()) $count_tag = id(new PHUITagView())
->setType(PHUITagView::TYPE_SHADE) ->setType(PHUITagView::TYPE_SHADE)
->setShade(PHUITagView::COLOR_BLUE) ->setColor(PHUITagView::COLOR_BLUE)
->addSigil('column-points') ->addSigil('column-points')
->setName( ->setName(
javelin_tag( javelin_tag(

View file

@ -211,7 +211,7 @@ final class PhabricatorProjectSearchEngine
$options[$color] = array( $options[$color] = array(
id(new PHUITagView()) id(new PHUITagView())
->setType(PHUITagView::TYPE_SHADE) ->setType(PHUITagView::TYPE_SHADE)
->setShade($color) ->setColor($color)
->setName($name), ->setName($name),
); );
} }

View file

@ -100,7 +100,7 @@ final class ProjectBoardTaskCard extends Phobject {
if ($points !== null) { if ($points !== null) {
$points_tag = id(new PHUITagView()) $points_tag = id(new PHUITagView())
->setType(PHUITagView::TYPE_SHADE) ->setType(PHUITagView::TYPE_SHADE)
->setShade(PHUITagView::COLOR_GREY) ->setColor(PHUITagView::COLOR_GREY)
->setSlimShady(true) ->setSlimShady(true)
->setName($points) ->setName($points)
->addClass('phui-workcard-points'); ->addClass('phui-workcard-points');

View file

@ -64,7 +64,7 @@ final class PhabricatorFulltextToken extends Phobject {
$tag = id(new PHUITagView()) $tag = id(new PHUITagView())
->setType(PHUITagView::TYPE_SHADE) ->setType(PHUITagView::TYPE_SHADE)
->setShade($shade) ->setColor($shade)
->setName($token->getValue()); ->setName($token->getValue());
if ($tip !== null) { if ($tip !== null) {

View file

@ -187,12 +187,12 @@ final class PHUITagExample extends PhabricatorUIExample {
foreach ($outlines as $outline) { foreach ($outlines as $outline) {
$tags[] = id(new PHUITagView()) $tags[] = id(new PHUITagView())
->setType(PHUITagView::TYPE_OUTLINE) ->setType(PHUITagView::TYPE_OUTLINE)
->setShade($outline) ->setColor($outline)
->setName($outline); ->setName($outline);
$tags[] = hsprintf(' '); $tags[] = hsprintf(' ');
$tags[] = id(new PHUITagView()) $tags[] = id(new PHUITagView())
->setType(PHUITagView::TYPE_OUTLINE) ->setType(PHUITagView::TYPE_OUTLINE)
->setShade($outline) ->setColor($outline)
->setSlimShady(true) ->setSlimShady(true)
->setName($outline); ->setName($outline);
$tags[] = hsprintf('<br /><br />'); $tags[] = hsprintf('<br /><br />');

View file

@ -148,7 +148,7 @@ final class PHUIDiffInlineCommentDetailView
->setType(PHUITagView::TYPE_SHADE) ->setType(PHUITagView::TYPE_SHADE)
->setName(pht('Unsubmitted')) ->setName(pht('Unsubmitted'))
->setSlimShady(true) ->setSlimShady(true)
->setShade(PHUITagView::COLOR_RED) ->setColor(PHUITagView::COLOR_RED)
->addClass('mml inline-draft-text'); ->addClass('mml inline-draft-text');
} }
@ -383,7 +383,7 @@ final class PHUIDiffInlineCommentDetailView
->setType(PHUITagView::TYPE_SHADE) ->setType(PHUITagView::TYPE_SHADE)
->setName(pht('Author')) ->setName(pht('Author'))
->setSlimShady(true) ->setSlimShady(true)
->setShade(PHUITagView::COLOR_YELLOW) ->setColor(PHUITagView::COLOR_YELLOW)
->addClass('mml'); ->addClass('mml');
} }
} }

View file

@ -60,7 +60,7 @@ final class PhabricatorNavigationRemarkupRule extends PhutilRemarkupRule {
$tag = id(new PHUITagView()) $tag = id(new PHUITagView())
->setType(PHUITagView::TYPE_SHADE) ->setType(PHUITagView::TYPE_SHADE)
->setShade($item_color) ->setColor($item_color)
->setName($item_name); ->setName($item_name);
if ($item['icon']) { if ($item['icon']) {

View file

@ -131,7 +131,7 @@ final class PHUIHeaderView extends AphrontTagView {
$tag = id(new PHUITagView()) $tag = id(new PHUITagView())
->setName($name) ->setName($name)
->setIcon($icon) ->setIcon($icon)
->setShade($color) ->setColor($color)
->setType(PHUITagView::TYPE_SHADE); ->setType(PHUITagView::TYPE_SHADE);
return $this->addProperty(self::PROPERTY_STATUS, $tag); return $this->addProperty(self::PROPERTY_STATUS, $tag);

View file

@ -57,8 +57,14 @@ final class PHUITagView extends AphrontTagView {
return $this; return $this;
} }
/* Deprecated, use setColor */ /**
* This method has been deprecated, use @{method:setColor} instead.
*
* @deprecated
*/
public function setShade($shade) { public function setShade($shade) {
phlog(
pht('Deprecated call to setShade(), use setColor() instead.'));
$this->color = $shade; $this->color = $shade;
return $this; return $this;
} }