]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Return `$this` from setter methods
authorJoshua Spence <josh@joshuaspence.com>
Thu, 25 Jun 2015 12:30:33 +0000 (22:30 +1000)
committerJoshua Spence <josh@joshuaspence.com>
Thu, 25 Jun 2015 12:30:33 +0000 (22:30 +1000)
Summary: Return `$this` from a bunch of setter methods for consistency. See also D13422.

Test Plan: Eyeball it.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D13423

src/configuration/ArcanistConfigurationManager.php
src/lint/linter/xhpast/ArcanistXHPASTLinterRule.php
src/unit/engine/NoseTestEngine.php
src/unit/engine/XUnitTestEngine.php

index d22847429a923ce56709195177a9fd597d4d3f11..3473a0bd6f6d0f85e393c5db0da287840dc13ff0 100644 (file)
@@ -13,6 +13,7 @@ final class ArcanistConfigurationManager extends Phobject {
   public function setWorkingCopyIdentity(
     ArcanistWorkingCopyIdentity $working_copy) {
     $this->workingCopy = $working_copy;
+    return $this;
   }
 
 /* -(  Get config  )--------------------------------------------------------- */
@@ -243,6 +244,7 @@ final class ArcanistConfigurationManager extends Phobject {
 
     $this->customArcrcFilename = $custom_arcrc;
     $this->userConfigCache = null;
+    return $this;
   }
 
   public function getUserConfigurationFileLocation() {
index 00c441947e640517d0939dff64f0abdb20719f6c..b98636f651f1d2f44fec18aa3080bb67af68d2b4 100644 (file)
@@ -69,6 +69,7 @@ abstract class ArcanistXHPASTLinterRule extends Phobject {
 
   final public function setLinter(ArcanistXHPASTLinter $linter) {
     $this->linter = $linter;
+    return $this;
   }
 
   /**
index 9af83c56af55794db521dc84e0708ce2b7c57496..5e5870e18a34a9bbc3970853d14248344f9b41ff 100644 (file)
@@ -64,7 +64,7 @@ final class NoseTestEngine extends ArcanistUnitTestEngine {
     foreach ($futures as $test_path => $future) {
       try {
         list($stdout, $stderr) = $future->resolvex();
-      } catch(CommandException $exc) {
+      } catch (CommandException $exc) {
         if ($exc->getError() > 1) {
           // 'nose' returns 1 when tests are failing/broken.
           throw $exc;
index d97c6f0ef70d9516713b7ce848fb954b989eb2c5..803880affc1fac556f2cd48a7106d45a34f42ac1 100644 (file)
@@ -250,7 +250,7 @@ class XUnitTestEngine extends ArcanistUnitTestEngine {
     try {
       $regenerate_future->resolvex();
       $result->setResult(ArcanistUnitTestResult::RESULT_PASS);
-    } catch(CommandException $exc) {
+    } catch (CommandException $exc) {
       if ($exc->getError() > 1) {
         throw $exc;
       }
@@ -296,7 +296,7 @@ class XUnitTestEngine extends ArcanistUnitTestEngine {
       try {
         $future->resolvex();
         $result->setResult(ArcanistUnitTestResult::RESULT_PASS);
-      } catch(CommandException $exc) {
+      } catch (CommandException $exc) {
         if ($exc->getError() > 1) {
           throw $exc;
         }