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

Fix some Phabricator lint warnings

Summary: Lint.

Test Plan: Lint.

Reviewers: chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6127
This commit is contained in:
epriestley 2013-06-04 15:28:24 -07:00
parent d9848d3c46
commit 5d1f94ac8a
10 changed files with 18 additions and 20 deletions

View file

@ -113,8 +113,7 @@ if (!$is_new) {
if (!$verify_email->getIsVerified()) {
$set_verified = phutil_console_confirm(
'Should the primary email address be verified?',
$default_no = true
);
$default_no = true);
} else {
// already verified so let's not make a fuss
$verify_email = null;

View file

@ -585,8 +585,8 @@ final class DifferentialHunkParser {
$end = $end + $add_context;
$hunk_content = array();
$hunk_pos = array( "-" => 0, "+" => 0 );
$hunk_offset = array( "-" => NULL, "+" => NULL );
$hunk_last = array( "-" => NULL, "+" => NULL );
$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;
@ -598,13 +598,13 @@ final class DifferentialHunkParser {
if (!$skip || ($hunk_pos[$prefix] != $start &&
$hunk_pos[$prefix] != $end)) {
if ($in_old) {
if ($hunk_offset["-"] === NULL) {
if ($hunk_offset["-"] === null) {
$hunk_offset["-"] = $hunk_pos["-"];
}
$hunk_last["-"] = $hunk_pos["-"];
}
if ($in_new) {
if ($hunk_offset["+"] === NULL) {
if ($hunk_offset["+"] === null) {
$hunk_offset["+"] = $hunk_pos["+"];
}
$hunk_last["+"] = $hunk_pos["+"];
@ -617,13 +617,13 @@ final class DifferentialHunkParser {
if ($in_new) { ++$hunk_pos["+"]; }
}
}
if ($hunk_offset["-"] !== NULL || $hunk_offset["+"] !== NULL) {
if ($hunk_offset["-"] !== null || $hunk_offset["+"] !== null) {
$header = "@@";
if ($hunk_offset["-"] !== NULL) {
if ($hunk_offset["-"] !== null) {
$header .= " -" . ($hunk->getOldOffset() + $hunk_offset["-"]) .
"," . ($hunk_last["-"] - $hunk_offset["-"] + 1);
}
if ($hunk_offset["+"] !== NULL) {
if ($hunk_offset["+"] !== null) {
$header .= " +" . ($hunk->getNewOffset() + $hunk_offset["+"]) .
"," . ($hunk_last["+"] - $hunk_offset["+"] + 1);
}

View file

@ -9,7 +9,7 @@ final class DifferentialHunkParserTestCase extends PhabricatorTestCase {
// $length: 0 based (0 meaning 1 line)
private function createNewComment($line, $length) {
$comment = $this->createComment();
$comment->setIsNewFile(True);
$comment->setIsNewFile(true);
$comment->setLineNumber($line);
$comment->setLineLength($length);
return $comment;
@ -18,7 +18,7 @@ final class DifferentialHunkParserTestCase extends PhabricatorTestCase {
// $length: 0 based (0 meaning 1 line)
private function createOldComment($line, $length) {
$comment = $this->createComment();
$comment->setIsNewFile(False);
$comment->setIsNewFile(false);
$comment->setLineNumber($line);
$comment->setLineLength($length);
return $comment;

View file

@ -61,12 +61,12 @@ final class PhabricatorObjectHandle {
}
return $this->getName();
}
public function setTitle($title) {
$this->title = $title;
return $this;
}
public function getTitle() {
return $this->title;
}

View file

@ -144,7 +144,7 @@ final class PholioMockEditor extends PhabricatorApplicationTransactionEditor {
$head = array();
$tail = array();
// Move inline comments to the end, so the comments preceed them.
// Move inline comments to the end, so the comments precede them.
foreach ($xactions as $xaction) {
$type = $xaction->getTransactionType();
if ($type == PholioTransactionType::TYPE_INLINE) {

View file

@ -841,7 +841,7 @@ abstract class PhabricatorApplicationTransactionEditor
$head = array();
$tail = array();
// Move bare comments to the end, so the actions preceed them.
// Move bare comments to the end, so the actions precede them.
foreach ($xactions as $xaction) {
$type = $xaction->getTransactionType();
if ($type == PhabricatorTransactions::TYPE_COMMENT) {

View file

@ -131,7 +131,7 @@ abstract class PhabricatorBotBaseStreamingProtocolAdapter
return false;
}
protected function performPost($endpoint, $data = Null) {
protected function performPost($endpoint, $data = null) {
$uri = new PhutilURI($this->server);
$uri->setPath($endpoint);

View file

@ -355,7 +355,7 @@ final class PhabricatorEdgeEditor extends PhabricatorEditor {
* response to edits, and is primarily useful when performing migrations. You
* should not normally need to use it.
*
* @param bool True to supress events related to edits.
* @param bool True to suppress events related to edits.
* @return this
* @task internal
*/

View file

@ -47,8 +47,7 @@ final class PhabricatorCrumbsView extends AphrontView {
array(
'class' => 'phabricator-crumbs-action-name'
),
$action->getName()
);
$action->getName());
$action_sigils = $action->getSigils();
if ($action->getWorkflow()) {

View file

@ -208,7 +208,7 @@ final class PHUIFeedStoryView extends AphrontView {
}
public function setAppIconFromPHID($phid) {
switch(phid_get_type($phid)) {
switch (phid_get_type($phid)) {
case PhabricatorPHIDConstants::PHID_TYPE_MOCK:
$this->setAppIcon("pholio-dark");
break;