1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-22 20:51:10 +01:00

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,13 +246,14 @@ abstract class AphrontApplicationConfiguration extends Phobject {
if ($response instanceof AphrontWebpageResponse) { if ($response instanceof AphrontWebpageResponse) {
echo phutil_tag( echo phutil_tag(
'div', 'div',
array('style' => array(
'background: #eeddff;'. 'style' =>
'white-space: pre-wrap;'. 'background: #eeddff;'.
'z-index: 200000;'. 'white-space: pre-wrap;'.
'position: relative;'. 'z-index: 200000;'.
'padding: 8px;'. 'position: relative;'.
'font-family: monospace', 'padding: 8px;'.
'font-family: monospace',
), ),
$unexpected_output); $unexpected_output);
} }

View file

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

View file

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

View file

@ -51,9 +51,10 @@ final class DifferentialCreateRawDiffConduitAPIMethod
'unitStatus' => DifferentialUnitStatus::UNIT_SKIP, 'unitStatus' => DifferentialUnitStatus::UNIT_SKIP,
); );
$xactions = array(id(new DifferentialTransaction()) $xactions = array(
->setTransactionType(DifferentialDiffTransaction::TYPE_DIFF_CREATE) id(new DifferentialTransaction())
->setNewValue($diff_data_dict), ->setTransactionType(DifferentialDiffTransaction::TYPE_DIFF_CREATE)
->setNewValue($diff_data_dict),
); );
if ($request->getValue('viewPolicy')) { if ($request->getValue('viewPolicy')) {

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,9 +67,10 @@ 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(
->setTransactionType($type_secret) id(new PassphraseCredentialTransaction())
->setNewValue(true), ->setTransactionType($type_secret)
->setNewValue(true),
); );
$editor = id(new PassphraseCredentialTransactionEditor()) $editor = id(new PassphraseCredentialTransactionEditor())

View file

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

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,10 +290,11 @@ final class AphrontDialogView extends AphrontView {
} }
if (!$this->renderAsForm) { if (!$this->renderAsForm) {
$buttons = array(phabricator_form( $buttons = array(
$this->user, phabricator_form(
$form_attributes, $this->user,
array_merge($hidden_inputs, $buttons)), $form_attributes,
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',