From 2cf9ded87892cef3312ac0e0d5b87d30afdc9d31 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Tue, 11 Aug 2015 22:36:15 +1000 Subject: [PATCH] Various linter fixes Summary: Self explanatory. Test Plan: `arc lint` Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D13863 --- .../AphrontApplicationConfiguration.php | 15 +++++++------- .../__tests__/ConpherenceTestCase.php | 14 +++++++------ ...DifferentialCreateDiffConduitAPIMethod.php | 7 ++++--- ...ferentialCreateRawDiffConduitAPIMethod.php | 7 ++++--- .../parser/DifferentialHunkParser.php | 6 +++--- .../PhabricatorHomeMainController.php | 2 +- .../PassphraseCredentialRevealController.php | 7 ++++--- ...PhabricatorProjectColumnHideController.php | 7 ++++--- .../engine/PhabricatorElasticSearchEngine.php | 2 +- .../uiexample/examples/PHUIButtonExample.php | 3 ++- .../sms/worker/PhabricatorSMSWorker.php | 4 +--- .../lisk/__tests__/LiskChunkTestCase.php | 19 ++++++++++++++---- .../__tests__/PhabricatorHashTestCase.php | 20 ++++++++++++++++--- src/view/AphrontDialogView.php | 9 +++++---- .../__tests__/PhabricatorUnitsTestCase.php | 2 +- 15 files changed, 78 insertions(+), 46 deletions(-) diff --git a/src/aphront/configuration/AphrontApplicationConfiguration.php b/src/aphront/configuration/AphrontApplicationConfiguration.php index d215d2f67a..0a33f6f77c 100644 --- a/src/aphront/configuration/AphrontApplicationConfiguration.php +++ b/src/aphront/configuration/AphrontApplicationConfiguration.php @@ -246,13 +246,14 @@ abstract class AphrontApplicationConfiguration extends Phobject { if ($response instanceof AphrontWebpageResponse) { echo phutil_tag( 'div', - array('style' => - 'background: #eeddff;'. - 'white-space: pre-wrap;'. - 'z-index: 200000;'. - 'position: relative;'. - 'padding: 8px;'. - 'font-family: monospace', + array( + 'style' => + 'background: #eeddff;'. + 'white-space: pre-wrap;'. + 'z-index: 200000;'. + 'position: relative;'. + 'padding: 8px;'. + 'font-family: monospace', ), $unexpected_output); } diff --git a/src/applications/conpherence/__tests__/ConpherenceTestCase.php b/src/applications/conpherence/__tests__/ConpherenceTestCase.php index 8de135f24e..ce9dc8ceee 100644 --- a/src/applications/conpherence/__tests__/ConpherenceTestCase.php +++ b/src/applications/conpherence/__tests__/ConpherenceTestCase.php @@ -7,9 +7,10 @@ abstract class ConpherenceTestCase extends PhabricatorTestCase { ConpherenceThread $conpherence, array $participant_phids) { - $xactions = array(id(new ConpherenceTransaction()) - ->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS) - ->setNewValue(array('+' => $participant_phids)), + $xactions = array( + id(new ConpherenceTransaction()) + ->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS) + ->setNewValue(array('+' => $participant_phids)), ); $editor = id(new ConpherenceEditor()) ->setActor($actor) @@ -23,9 +24,10 @@ abstract class ConpherenceTestCase extends PhabricatorTestCase { ConpherenceThread $conpherence, array $participant_phids) { - $xactions = array(id(new ConpherenceTransaction()) - ->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS) - ->setNewValue(array('-' => $participant_phids)), + $xactions = array( + id(new ConpherenceTransaction()) + ->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS) + ->setNewValue(array('-' => $participant_phids)), ); $editor = id(new ConpherenceEditor()) ->setActor($actor) diff --git a/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php index 4a5b749268..41f5f34770 100644 --- a/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php +++ b/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php @@ -143,9 +143,10 @@ final class DifferentialCreateDiffConduitAPIMethod 'unitStatus' => $unit_status, ); - $xactions = array(id(new DifferentialTransaction()) - ->setTransactionType(DifferentialDiffTransaction::TYPE_DIFF_CREATE) - ->setNewValue($diff_data_dict), + $xactions = array( + id(new DifferentialTransaction()) + ->setTransactionType(DifferentialDiffTransaction::TYPE_DIFF_CREATE) + ->setNewValue($diff_data_dict), ); id(new DifferentialDiffEditor()) diff --git a/src/applications/differential/conduit/DifferentialCreateRawDiffConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialCreateRawDiffConduitAPIMethod.php index e8dd29f86a..c69a06bd9a 100644 --- a/src/applications/differential/conduit/DifferentialCreateRawDiffConduitAPIMethod.php +++ b/src/applications/differential/conduit/DifferentialCreateRawDiffConduitAPIMethod.php @@ -51,9 +51,10 @@ final class DifferentialCreateRawDiffConduitAPIMethod 'unitStatus' => DifferentialUnitStatus::UNIT_SKIP, ); - $xactions = array(id(new DifferentialTransaction()) - ->setTransactionType(DifferentialDiffTransaction::TYPE_DIFF_CREATE) - ->setNewValue($diff_data_dict), + $xactions = array( + id(new DifferentialTransaction()) + ->setTransactionType(DifferentialDiffTransaction::TYPE_DIFF_CREATE) + ->setNewValue($diff_data_dict), ); if ($request->getValue('viewPolicy')) { diff --git a/src/applications/differential/parser/DifferentialHunkParser.php b/src/applications/differential/parser/DifferentialHunkParser.php index 8903c85f93..22b82e002e 100644 --- a/src/applications/differential/parser/DifferentialHunkParser.php +++ b/src/applications/differential/parser/DifferentialHunkParser.php @@ -603,9 +603,9 @@ final class DifferentialHunkParser extends Phobject { $start = $start - $add_context; $end = $end + $add_context; $hunk_content = array(); - $hunk_pos = array( '-' => 0, '+' => 0 ); - $hunk_offset = array( '-' => null, '+' => null ); - $hunk_last = array( '-' => null, '+' => null ); + $hunk_pos = array('-' => 0, '+' => 0); + $hunk_offset = array('-' => null, '+' => null); + $hunk_last = array('-' => null, '+' => null); foreach (explode("\n", $hunk->getChanges()) as $line) { $in_common = strncmp($line, ' ', 1) === 0; $in_old = strncmp($line, '-', 1) === 0 || $in_common; diff --git a/src/applications/home/controller/PhabricatorHomeMainController.php b/src/applications/home/controller/PhabricatorHomeMainController.php index 2442d69bd8..6307374c7f 100644 --- a/src/applications/home/controller/PhabricatorHomeMainController.php +++ b/src/applications/home/controller/PhabricatorHomeMainController.php @@ -219,7 +219,7 @@ final class PhabricatorHomeMainController extends PhabricatorHomeController { $revisions = $revision_query->execute(); - list($blocking, $active, ) = DifferentialRevisionQuery::splitResponsible( + list($blocking, $active,) = DifferentialRevisionQuery::splitResponsible( $revisions, array($user_phid)); diff --git a/src/applications/passphrase/controller/PassphraseCredentialRevealController.php b/src/applications/passphrase/controller/PassphraseCredentialRevealController.php index c61086b0e7..fb784fb5b8 100644 --- a/src/applications/passphrase/controller/PassphraseCredentialRevealController.php +++ b/src/applications/passphrase/controller/PassphraseCredentialRevealController.php @@ -67,9 +67,10 @@ final class PassphraseCredentialRevealController ->addCancelButton($view_uri, pht('Done')); $type_secret = PassphraseCredentialTransaction::TYPE_LOOKEDATSECRET; - $xactions = array(id(new PassphraseCredentialTransaction()) - ->setTransactionType($type_secret) - ->setNewValue(true), + $xactions = array( + id(new PassphraseCredentialTransaction()) + ->setTransactionType($type_secret) + ->setNewValue(true), ); $editor = id(new PassphraseCredentialTransactionEditor()) diff --git a/src/applications/project/controller/PhabricatorProjectColumnHideController.php b/src/applications/project/controller/PhabricatorProjectColumnHideController.php index 167cbfbd2e..ae39e783bb 100644 --- a/src/applications/project/controller/PhabricatorProjectColumnHideController.php +++ b/src/applications/project/controller/PhabricatorProjectColumnHideController.php @@ -60,9 +60,10 @@ final class PhabricatorProjectColumnHideController } $type_status = PhabricatorProjectColumnTransaction::TYPE_STATUS; - $xactions = array(id(new PhabricatorProjectColumnTransaction()) - ->setTransactionType($type_status) - ->setNewValue($new_status), + $xactions = array( + id(new PhabricatorProjectColumnTransaction()) + ->setTransactionType($type_status) + ->setNewValue($new_status), ); $editor = id(new PhabricatorProjectColumnTransactionEditor()) diff --git a/src/applications/search/engine/PhabricatorElasticSearchEngine.php b/src/applications/search/engine/PhabricatorElasticSearchEngine.php index fa09e64a9c..e99160839f 100644 --- a/src/applications/search/engine/PhabricatorElasticSearchEngine.php +++ b/src/applications/search/engine/PhabricatorElasticSearchEngine.php @@ -325,7 +325,7 @@ final class PhabricatorElasticSearchEngine extends PhabricatorSearchEngine { foreach ($types as $type) { // Use the custom trigram analyzer for the corpus of text $data['mappings'][$type]['properties']['field']['properties']['corpus'] = - array( 'type' => 'string', 'analyzer' => 'custom_trigrams' ); + array('type' => 'string', 'analyzer' => 'custom_trigrams'); // Ensure we have dateCreated since the default query requires it $data['mappings'][$type]['properties']['dateCreated']['type'] = 'string'; diff --git a/src/applications/uiexample/examples/PHUIButtonExample.php b/src/applications/uiexample/examples/PHUIButtonExample.php index 216a4a4406..06cf369ba2 100644 --- a/src/applications/uiexample/examples/PHUIButtonExample.php +++ b/src/applications/uiexample/examples/PHUIButtonExample.php @@ -68,7 +68,8 @@ final class PHUIButtonExample extends PhabricatorUIExample { // PHUIButtonView - $colors = array(null, + $colors = array( + null, PHUIButtonView::GREEN, PHUIButtonView::GREY, PHUIButtonView::DISABLED, diff --git a/src/infrastructure/sms/worker/PhabricatorSMSWorker.php b/src/infrastructure/sms/worker/PhabricatorSMSWorker.php index 145a371e7d..7b8f851eaa 100644 --- a/src/infrastructure/sms/worker/PhabricatorSMSWorker.php +++ b/src/infrastructure/sms/worker/PhabricatorSMSWorker.php @@ -1,6 +1,4 @@ assertEqual( @@ -38,7 +47,9 @@ final class LiskChunkTestCase extends PhabricatorTestCase { $fragments = array( 'xxxxxxxxxx', 'yyyyyyyyyy', - 'a', 'b', 'c', + 'a', + 'b', + 'c', 'zzzzzzzzzz', ); diff --git a/src/infrastructure/util/__tests__/PhabricatorHashTestCase.php b/src/infrastructure/util/__tests__/PhabricatorHashTestCase.php index c6839dae09..b89515701d 100644 --- a/src/infrastructure/util/__tests__/PhabricatorHashTestCase.php +++ b/src/infrastructure/util/__tests__/PhabricatorHashTestCase.php @@ -19,9 +19,23 @@ final class PhabricatorHashTestCase extends PhabricatorTestCase { // Test that the encoding produces 6 bits of entropy per byte. $entropy = array( - 'dog', 'cat', 'rat', 'bat', 'dig', 'fig', 'cot', - 'cut', 'fog', 'rig', 'rug', 'dug', 'mat', 'pat', - 'eat', 'tar', 'pot', + 'dog', + 'cat', + 'rat', + 'bat', + 'dig', + 'fig', + 'cot', + 'cut', + 'fog', + 'rig', + 'rug', + 'dug', + 'mat', + 'pat', + 'eat', + 'tar', + 'pot', ); $seen = array(); diff --git a/src/view/AphrontDialogView.php b/src/view/AphrontDialogView.php index 19210c312d..ca866b11a8 100644 --- a/src/view/AphrontDialogView.php +++ b/src/view/AphrontDialogView.php @@ -290,10 +290,11 @@ final class AphrontDialogView extends AphrontView { } if (!$this->renderAsForm) { - $buttons = array(phabricator_form( - $this->user, - $form_attributes, - array_merge($hidden_inputs, $buttons)), + $buttons = array( + phabricator_form( + $this->user, + $form_attributes, + array_merge($hidden_inputs, $buttons)), ); } diff --git a/src/view/__tests__/PhabricatorUnitsTestCase.php b/src/view/__tests__/PhabricatorUnitsTestCase.php index bd0f535008..aae9598ddf 100644 --- a/src/view/__tests__/PhabricatorUnitsTestCase.php +++ b/src/view/__tests__/PhabricatorUnitsTestCase.php @@ -55,7 +55,7 @@ final class PhabricatorUnitsTestCase extends PhabricatorTestCase { public function testDetailedDurationFormatting() { $expected_zero = 'now'; - $tests = array ( + $tests = array( 12095939 => '19 w, 6 d', -12095939 => '19 w, 6 d ago',