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
This commit is contained in:
Joshua Spence 2015-08-11 22:36:15 +10:00
parent 5485fb8aa9
commit 2cf9ded878
15 changed files with 78 additions and 46 deletions

View file

@ -246,7 +246,8 @@ abstract class AphrontApplicationConfiguration extends Phobject {
if ($response instanceof AphrontWebpageResponse) { if ($response instanceof AphrontWebpageResponse) {
echo phutil_tag( echo phutil_tag(
'div', 'div',
array('style' => array(
'style' =>
'background: #eeddff;'. 'background: #eeddff;'.
'white-space: pre-wrap;'. 'white-space: pre-wrap;'.
'z-index: 200000;'. 'z-index: 200000;'.

View file

@ -7,7 +7,8 @@ abstract class ConpherenceTestCase extends PhabricatorTestCase {
ConpherenceThread $conpherence, ConpherenceThread $conpherence,
array $participant_phids) { array $participant_phids) {
$xactions = array(id(new ConpherenceTransaction()) $xactions = array(
id(new ConpherenceTransaction())
->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS) ->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
->setNewValue(array('+' => $participant_phids)), ->setNewValue(array('+' => $participant_phids)),
); );
@ -23,7 +24,8 @@ abstract class ConpherenceTestCase extends PhabricatorTestCase {
ConpherenceThread $conpherence, ConpherenceThread $conpherence,
array $participant_phids) { array $participant_phids) {
$xactions = array(id(new ConpherenceTransaction()) $xactions = array(
id(new ConpherenceTransaction())
->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS) ->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
->setNewValue(array('-' => $participant_phids)), ->setNewValue(array('-' => $participant_phids)),
); );

View file

@ -143,7 +143,8 @@ final class DifferentialCreateDiffConduitAPIMethod
'unitStatus' => $unit_status, 'unitStatus' => $unit_status,
); );
$xactions = array(id(new DifferentialTransaction()) $xactions = array(
id(new DifferentialTransaction())
->setTransactionType(DifferentialDiffTransaction::TYPE_DIFF_CREATE) ->setTransactionType(DifferentialDiffTransaction::TYPE_DIFF_CREATE)
->setNewValue($diff_data_dict), ->setNewValue($diff_data_dict),
); );

View file

@ -51,7 +51,8 @@ final class DifferentialCreateRawDiffConduitAPIMethod
'unitStatus' => DifferentialUnitStatus::UNIT_SKIP, 'unitStatus' => DifferentialUnitStatus::UNIT_SKIP,
); );
$xactions = array(id(new DifferentialTransaction()) $xactions = array(
id(new DifferentialTransaction())
->setTransactionType(DifferentialDiffTransaction::TYPE_DIFF_CREATE) ->setTransactionType(DifferentialDiffTransaction::TYPE_DIFF_CREATE)
->setNewValue($diff_data_dict), ->setNewValue($diff_data_dict),
); );

View file

@ -603,9 +603,9 @@ final class DifferentialHunkParser extends Phobject {
$start = $start - $add_context; $start = $start - $add_context;
$end = $end + $add_context; $end = $end + $add_context;
$hunk_content = array(); $hunk_content = array();
$hunk_pos = array( '-' => 0, '+' => 0 ); $hunk_pos = array('-' => 0, '+' => 0);
$hunk_offset = array( '-' => null, '+' => null ); $hunk_offset = array('-' => null, '+' => null);
$hunk_last = array( '-' => null, '+' => null ); $hunk_last = array('-' => null, '+' => null);
foreach (explode("\n", $hunk->getChanges()) as $line) { foreach (explode("\n", $hunk->getChanges()) as $line) {
$in_common = strncmp($line, ' ', 1) === 0; $in_common = strncmp($line, ' ', 1) === 0;
$in_old = strncmp($line, '-', 1) === 0 || $in_common; $in_old = strncmp($line, '-', 1) === 0 || $in_common;

View file

@ -219,7 +219,7 @@ final class PhabricatorHomeMainController extends PhabricatorHomeController {
$revisions = $revision_query->execute(); $revisions = $revision_query->execute();
list($blocking, $active, ) = DifferentialRevisionQuery::splitResponsible( list($blocking, $active,) = DifferentialRevisionQuery::splitResponsible(
$revisions, $revisions,
array($user_phid)); array($user_phid));

View file

@ -67,7 +67,8 @@ final class PassphraseCredentialRevealController
->addCancelButton($view_uri, pht('Done')); ->addCancelButton($view_uri, pht('Done'));
$type_secret = PassphraseCredentialTransaction::TYPE_LOOKEDATSECRET; $type_secret = PassphraseCredentialTransaction::TYPE_LOOKEDATSECRET;
$xactions = array(id(new PassphraseCredentialTransaction()) $xactions = array(
id(new PassphraseCredentialTransaction())
->setTransactionType($type_secret) ->setTransactionType($type_secret)
->setNewValue(true), ->setNewValue(true),
); );

View file

@ -60,7 +60,8 @@ final class PhabricatorProjectColumnHideController
} }
$type_status = PhabricatorProjectColumnTransaction::TYPE_STATUS; $type_status = PhabricatorProjectColumnTransaction::TYPE_STATUS;
$xactions = array(id(new PhabricatorProjectColumnTransaction()) $xactions = array(
id(new PhabricatorProjectColumnTransaction())
->setTransactionType($type_status) ->setTransactionType($type_status)
->setNewValue($new_status), ->setNewValue($new_status),
); );

View file

@ -325,7 +325,7 @@ final class PhabricatorElasticSearchEngine extends PhabricatorSearchEngine {
foreach ($types as $type) { foreach ($types as $type) {
// Use the custom trigram analyzer for the corpus of text // Use the custom trigram analyzer for the corpus of text
$data['mappings'][$type]['properties']['field']['properties']['corpus'] = $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 // Ensure we have dateCreated since the default query requires it
$data['mappings'][$type]['properties']['dateCreated']['type'] = 'string'; $data['mappings'][$type]['properties']['dateCreated']['type'] = 'string';

View file

@ -68,7 +68,8 @@ final class PHUIButtonExample extends PhabricatorUIExample {
// PHUIButtonView // PHUIButtonView
$colors = array(null, $colors = array(
null,
PHUIButtonView::GREEN, PHUIButtonView::GREEN,
PHUIButtonView::GREY, PHUIButtonView::GREY,
PHUIButtonView::DISABLED, PHUIButtonView::DISABLED,

View file

@ -1,6 +1,4 @@
<?php <?php
abstract class PhabricatorSMSWorker abstract class PhabricatorSMSWorker
extends PhabricatorWorker { extends PhabricatorWorker {}
}

View file

@ -4,8 +4,10 @@ final class LiskChunkTestCase extends PhabricatorTestCase {
public function testSQLChunking() { public function testSQLChunking() {
$fragments = array( $fragments = array(
'a', 'a', 'a',
'b', 'b', 'a',
'b',
'b',
'ccc', 'ccc',
'dd', 'dd',
'e', 'e',
@ -23,7 +25,14 @@ final class LiskChunkTestCase extends PhabricatorTestCase {
$fragments = array( $fragments = array(
'a', 'a', 'a', 'XX', 'a', 'a', 'a', 'a', 'a',
'a',
'a',
'XX',
'a',
'a',
'a',
'a',
); );
$this->assertEqual( $this->assertEqual(
@ -38,7 +47,9 @@ final class LiskChunkTestCase extends PhabricatorTestCase {
$fragments = array( $fragments = array(
'xxxxxxxxxx', 'xxxxxxxxxx',
'yyyyyyyyyy', 'yyyyyyyyyy',
'a', 'b', 'c', 'a',
'b',
'c',
'zzzzzzzzzz', 'zzzzzzzzzz',
); );

View file

@ -19,9 +19,23 @@ final class PhabricatorHashTestCase extends PhabricatorTestCase {
// Test that the encoding produces 6 bits of entropy per byte. // Test that the encoding produces 6 bits of entropy per byte.
$entropy = array( $entropy = array(
'dog', 'cat', 'rat', 'bat', 'dig', 'fig', 'cot', 'dog',
'cut', 'fog', 'rig', 'rug', 'dug', 'mat', 'pat', 'cat',
'eat', 'tar', 'pot', 'rat',
'bat',
'dig',
'fig',
'cot',
'cut',
'fog',
'rig',
'rug',
'dug',
'mat',
'pat',
'eat',
'tar',
'pot',
); );
$seen = array(); $seen = array();

View file

@ -290,7 +290,8 @@ final class AphrontDialogView extends AphrontView {
} }
if (!$this->renderAsForm) { if (!$this->renderAsForm) {
$buttons = array(phabricator_form( $buttons = array(
phabricator_form(
$this->user, $this->user,
$form_attributes, $form_attributes,
array_merge($hidden_inputs, $buttons)), array_merge($hidden_inputs, $buttons)),

View file

@ -55,7 +55,7 @@ final class PhabricatorUnitsTestCase extends PhabricatorTestCase {
public function testDetailedDurationFormatting() { public function testDetailedDurationFormatting() {
$expected_zero = 'now'; $expected_zero = 'now';
$tests = array ( $tests = array(
12095939 => '19 w, 6 d', 12095939 => '19 w, 6 d',
-12095939 => '19 w, 6 d ago', -12095939 => '19 w, 6 d ago',