1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 05:50:55 +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) {
$this->debug = $debug;
return $this;
}
public static function requireExtensions() {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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