1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 07:12:41 +01:00

Return $this from setter methods

Summary: Return `$this` from setter methods for consistency. I started writing a [[https://secure.phabricator.com/differential/diff/32506/ | linter rule]] to detect this, but I don't think it is trivial to do this properly.

Test Plan: Eyeball it.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D13422
This commit is contained in:
Joshua Spence 2015-07-06 22:53:41 +10:00
parent acb1eb81cc
commit f2435fd1d0
12 changed files with 15 additions and 0 deletions

View file

@ -88,6 +88,7 @@ abstract class PhabricatorAphlictManagementWorkflow
final protected function setDebug($debug) { final protected function setDebug($debug) {
$this->debug = $debug; $this->debug = $debug;
return $this;
} }
public static function requireExtensions() { public static function requireExtensions() {

View file

@ -257,6 +257,7 @@ final class DifferentialChangesetParser extends Phobject {
$this->originalLeft = $left; $this->originalLeft = $left;
$this->originalRight = $right; $this->originalRight = $right;
return $this;
} }
public function diffOriginals() { public function diffOriginals() {

View file

@ -370,6 +370,7 @@ final class DivinerAtom extends Phobject {
public function setProperty($key, $value) { public function setProperty($key, $value) {
$this->properties[$key] = $value; $this->properties[$key] = $value;
return $this;
} }
public function getProperties() { public function getProperties() {

View file

@ -15,6 +15,7 @@ final class LegalpadDocumentEditor
private function setIsContribution($is_contribution) { private function setIsContribution($is_contribution) {
$this->isContribution = $is_contribution; $this->isContribution = $is_contribution;
return $this;
} }
private function isContribution() { private function isContribution() {

View file

@ -20,6 +20,7 @@ final class PhabricatorMetaMTAMailBody extends Phobject {
public function setViewer($viewer) { public function setViewer($viewer) {
$this->viewer = $viewer; $this->viewer = $viewer;
return $this;
} }
/* -( Composition )-------------------------------------------------------- */ /* -( Composition )-------------------------------------------------------- */

View file

@ -24,6 +24,7 @@ final class PasteEmbedView extends AphrontView {
public function setLines($lines) { public function setLines($lines) {
$this->lines = $lines; $this->lines = $lines;
return $this;
} }
public function render() { public function render() {

View file

@ -302,6 +302,8 @@ final class ReleephRequestTransactionalEditor
'RQ'.$id)); 'RQ'.$id));
break; break;
} }
return $this;
} }
} }

View file

@ -110,6 +110,7 @@ abstract class ReleephFieldSpecification
$this->getRequiredStorageKey()); $this->getRequiredStorageKey());
$this->validate($value); $this->validate($value);
$this->setValue($value); $this->setValue($value);
return $this;
} }

View file

@ -118,6 +118,7 @@ abstract class ReleephLevelFieldSpecification
pht("Unknown %s level name '%s'", $label, $name)); pht("Unknown %s level name '%s'", $label, $name));
} }
$this->setValue($level); $this->setValue($level);
return $this;
} }
private $nameMap = array(); private $nameMap = array();

View file

@ -438,6 +438,8 @@ final class PhabricatorRepositoryRefEngine
PhabricatorWorker::scheduleTask($class, $data); PhabricatorWorker::scheduleTask($class, $data);
} }
} }
return $this;
} }

View file

@ -513,6 +513,8 @@ abstract class PhabricatorApplicationSearchEngine extends Phobject {
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST, PhabricatorProjectObjectHasProjectEdgeType::EDGECONST,
$constraints); $constraints);
} }
return $this;
} }

View file

@ -42,6 +42,7 @@ abstract class PhabricatorStandardCustomFieldPHIDs
} }
} }
$this->setFieldValue($value); $this->setFieldValue($value);
return $this;
} }
public function readApplicationSearchValueFromRequest( public function readApplicationSearchValueFromRequest(