Skip to content
Permalink
Browse files

Fix PHPDoc @return by replacing $this to self

  • Loading branch information...
garas committed Jan 28, 2016
1 parent a890d76 commit fde1d08b439fa0a300a7729cb36778850c5e94f0
@@ -218,7 +218,7 @@ public static function buildFromArray($spec) {
* Get or set the command name for shell/task.
*
* @param string $text The text to set, or null if you want to read
* @return string|$this If reading, the value of the command. If setting $this will be returned.
* @return string|self If reading, the value of the command. If setting $this will be returned.
*/
public function command($text = null) {
if ($text !== null) {
@@ -233,7 +233,7 @@ public function command($text = null) {
*
* @param string|array $text The text to set, or null if you want to read. If an array the
* text will be imploded with "\n"
* @return string|$this If reading, the value of the description. If setting $this will be returned.
* @return string|self If reading, the value of the description. If setting $this will be returned.
*/
public function description($text = null) {
if ($text !== null) {
@@ -251,7 +251,7 @@ public function description($text = null) {
* the options and arguments listing when help is generated.
*
* @param string|array $text Text when setting or null when reading. If an array the text will be imploded with "\n"
* @return string|$this If reading, the value of the epilog. If setting $this will be returned.
* @return string|self If reading, the value of the epilog. If setting $this will be returned.
*/
public function epilog($text = null) {
if ($text !== null) {
@@ -284,7 +284,7 @@ public function epilog($text = null) {
* @param ConsoleInputOption|string $name The long name you want to the value to be parsed out as when options are parsed.
* Will also accept an instance of ConsoleInputOption
* @param array $options An array of parameters that define the behavior of the option
* @return $this
* @return self
*/
public function addOption($name, $options = array()) {
if (is_object($name) && $name instanceof ConsoleInputOption) {
@@ -324,7 +324,7 @@ public function addOption($name, $options = array()) {
*
* @param ConsoleInputArgument|string $name The name of the argument. Will also accept an instance of ConsoleInputArgument
* @param array $params Parameters for the argument, see above.
* @return $this
* @return self
*/
public function addArgument($name, $params = array()) {
if (is_object($name) && $name instanceof ConsoleInputArgument) {
@@ -354,7 +354,7 @@ public function addArgument($name, $params = array()) {
*
* @param array $args Array of arguments to add.
* @see ConsoleOptionParser::addArgument()
* @return $this
* @return self
*/
public function addArguments(array $args) {
foreach ($args as $name => $params) {
@@ -369,7 +369,7 @@ public function addArguments(array $args) {
*
* @param array $options Array of options to add.
* @see ConsoleOptionParser::addOption()
* @return $this
* @return self
*/
public function addOptions(array $options) {
foreach ($options as $name => $params) {
@@ -391,7 +391,7 @@ public function addOptions(array $options) {
*
* @param ConsoleInputSubcommand|string $name Name of the subcommand. Will also accept an instance of ConsoleInputSubcommand
* @param array $options Array of params, see above.
* @return $this
* @return self
*/
public function addSubcommand($name, $options = array()) {
if (is_object($name) && $name instanceof ConsoleInputSubcommand) {
@@ -414,7 +414,7 @@ public function addSubcommand($name, $options = array()) {
* Remove a subcommand from the option parser.
*
* @param string $name The subcommand name to remove.
* @return $this
* @return self
*/
public function removeSubcommand($name) {
unset($this->_subcommands[$name]);
@@ -425,7 +425,7 @@ public function removeSubcommand($name) {
* Add multiple subcommands at once.
*
* @param array $commands Array of subcommands.
* @return $this
* @return self
*/
public function addSubcommands(array $commands) {
foreach ($commands as $name => $params) {
@@ -469,7 +469,7 @@ public function subcommands() {
* @param array $argv Array of args (argv) to parse.
* @param string $command The subcommand to use. If this parameter is a subcommand, that has a parser,
* That parser will be used to parse $argv instead.
* @return Array array($params, $args)
* @return array array($params, $args)
* @throws ConsoleException When an invalid parameter is encountered.
*/
public function parse($argv, $command = null) {
@@ -363,7 +363,7 @@ protected function _parseRules() {
* Sets the I18n domain for validation messages. This method is chainable.
*
* @param string $validationDomain [optional] The validation domain to be used.
* @return $this
* @return self
*/
public function setValidationDomain($validationDomain = null) {
if (empty($validationDomain)) {
@@ -549,7 +549,7 @@ public function count() {
* @param string $field The name of the field where the rule is to be added
* @param string|array|CakeValidationSet $name name of the rule to be added or list of rules for the field
* @param array|CakeValidationRule $rule or list of rules to be added to the field's rule set
* @return $this
* @return self
*/
public function add($field, $name, $rule = null) {
$this->_parseRules();
@@ -588,7 +588,7 @@ public function add($field, $name, $rule = null) {
*
* @param string $field The name of the field from which the rule will be removed
* @param string $rule the name of the rule to be removed
* @return $this
* @return self
*/
public function remove($field, $rule = null) {
$this->_parseRules();
@@ -191,7 +191,7 @@ public function getRules() {
*
* @param string $name The name under which the rule should be set
* @param CakeValidationRule|array $rule The validation rule to be set
* @return $this
* @return self
*/
public function setRule($name, $rule) {
if (!($rule instanceof CakeValidationRule)) {
@@ -213,7 +213,7 @@ public function setRule($name, $rule) {
* ```
*
* @param string $name The name under which the rule should be unset
* @return $this
* @return self
*/
public function removeRule($name) {
unset($this->_rules[$name]);
@@ -234,7 +234,7 @@ public function removeRule($name) {
*
* @param array $rules The rules to be set
* @param bool $mergeVars [optional] If true, merges vars instead of replace. Defaults to true.
* @return $this
* @return self
*/
public function setRules($rules = array(), $mergeVars = true) {
if ($mergeVars === false) {
@@ -695,7 +695,7 @@ public function addDetector($name, $options) {
* This modifies the parameters available through `$request->params`.
*
* @param array $params Array of parameters to merge in
* @return $this
* @return self
*/
public function addParams($params) {
$this->params = array_merge($this->params, (array)$params);
@@ -707,7 +707,7 @@ public function addParams($params) {
* Provides an easy way to modify, here, webroot and base.
*
* @param array $paths Array of paths to merge in
* @return $this
* @return self
*/
public function addPaths($paths) {
foreach (array('webroot', 'here', 'base') as $element) {
@@ -948,7 +948,7 @@ public function query($name) {
* will be created for you.
*
* @param string $name Dot separated name of the value to read/write, one or more args.
* @return mixed|$this Either the value being read, or $this so you can chain consecutive writes.
* @return mixed|self Either the value being read, or $this so you can chain consecutive writes.
*/
public function data($name) {
$args = func_get_args();
Oops, something went wrong.

0 comments on commit fde1d08

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.