]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Return $this from setters
authorvrana <jakubv@fb.com>
Tue, 3 Apr 2012 01:35:19 +0000 (18:35 -0700)
committervrana <jakubv@fb.com>
Tue, 3 Apr 2012 01:47:59 +0000 (18:47 -0700)
Summary:
Most setters returns `$this` but some don't.
I guess it's not by purpose.

Test Plan:
  arc lint

Reviewers: epriestley

Reviewed By: epriestley

CC: aran
Differential Revision: https://secure.phabricator.com/D2084

src/branch/BranchInfo.php
src/lint/engine/base/ArcanistLintEngine.php
src/lint/linter/phutilmodule/ArcanistPhutilModuleLinter.php
src/parser/bundle/ArcanistBundle.php
src/parser/diff/ArcanistDiffParser.php
src/unit/engine/base/ArcanistBaseUnitTestEngine.php
src/workflow/unit/ArcanistUnitWorkflow.php

index c919be7798ff926d58974140369d895cd150cfe3..d1a6eda52b5dace904e84247ce2abe4f7be53ee5 100644 (file)
@@ -77,6 +77,7 @@ final class BranchInfo {
 
   public function setCurrent() {
     $this->currentHead = true;
+    return $this;
   }
 
   public function isCurrentHead() {
@@ -86,6 +87,7 @@ final class BranchInfo {
 
   public function setStatus($status) {
     $this->status = $status;
+    return $this;
   }
 
   public function getStatus() {
index 45edff2897819af6cbeb8e3e15862b909e42838e..8d7cee4f4b11e4784251fe5b084c44ad9372823a 100644 (file)
@@ -119,6 +119,7 @@ abstract class ArcanistLintEngine {
 
   public function setHookAPI(ArcanistHookAPI $hook_api) {
     $this->hookAPI  = $hook_api;
+    return $this;
   }
 
   public function getHookAPI() {
index 730e5b2716613788d763e8313cdc0cc5b880f5b7..b7c30665b10a3ec879ddc5c6918b8314c2d2e405 100644 (file)
@@ -73,6 +73,7 @@ final class ArcanistPhutilModuleLinter extends ArcanistLinter {
 
   private function setModuleInfo($key, array $info) {
     $this->moduleInfo[$key] = $info;
+    return $this;
   }
 
   private function getModulePathOnDisk($key) {
index 609bc7fa74f23675ea388bd92f45b430effc009a..f96c8d0c9d53a3d53ea06c500344f07b4f863f19 100644 (file)
@@ -34,10 +34,12 @@ final class ArcanistBundle {
 
   public function setConduit(ConduitClient $conduit) {
     $this->conduit = $conduit;
+    return $this;
   }
 
   public function setProjectID($project_id) {
     $this->projectID = $project_id;
+    return $this;
   }
 
   public function getProjectID() {
@@ -46,6 +48,7 @@ final class ArcanistBundle {
 
   public function setBaseRevision($base_revision) {
     $this->baseRevision = $base_revision;
+    return $this;
   }
 
   public function setEncoding($encoding) {
index f1614d68e6e7bbd1c2ed5930251edcea255ad9da..344c72c269cd23dadd8265cb7aee501cc4b6c2bc 100644 (file)
@@ -50,6 +50,7 @@ final class ArcanistDiffParser {
 
   public function setTryEncoding($encoding) {
     $this->tryEncoding = $encoding;
+    return $this;
   }
 
   public function forcePath($path) {
index dc7f492b2054e58fd9dcf208b3ffb076e377bc20..2f7473eeb3dd44f3982007b6cf40cf5251ede3f3 100644 (file)
@@ -65,6 +65,7 @@ abstract class ArcanistBaseUnitTestEngine {
 
   final public function setEnableAsyncTests($enable_async_tests) {
     $this->enableAsyncTests = $enable_async_tests;
+    return $this;
   }
 
   final public function getEnableAsyncTests() {
@@ -89,6 +90,7 @@ abstract class ArcanistBaseUnitTestEngine {
    */
   public function setDifferentialDiffID($id) {
     $this->diffID = $id;
+    return $this;
   }
 
   /**
index f263d049a86c2e86b27246e2628fbe40677f0f7f..fee18583c05fd97ac259e81c78c9fdc250dd1a8e 100644 (file)
@@ -269,6 +269,7 @@ EOTEXT
     if ($this->engine) {
       $this->engine->setDifferentialDiffID($id);
     }
+    return $this;
   }
 
   private static function formatTestDuration($seconds) {