Skip to content

Commit

Permalink
Fix up doc block return types for chaining.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Jan 14, 2017
1 parent ec7f590 commit cd379b2
Show file tree
Hide file tree
Showing 57 changed files with 326 additions and 328 deletions.
32 changes: 16 additions & 16 deletions src/Console/ConsoleOptionParser.php
Expand Up @@ -169,11 +169,11 @@ public function __construct($command = null, $defaultOptions = true)
*
* @param string|null $command The command name this parser is for. The command name is used for generating help.
* @param bool $defaultOptions Whether you want the verbose and quiet options set.
* @return self
* @return static
*/
public static function create($command, $defaultOptions = true)
{
return new ConsoleOptionParser($command, $defaultOptions);
return new static($command, $defaultOptions);
}

/**
Expand All @@ -197,11 +197,11 @@ public static function create($command, $defaultOptions = true)
*
* @param array $spec The spec to build the OptionParser with.
* @param bool $defaultOptions Whether you want the verbose and quiet options set.
* @return self
* @return static
*/
public static function buildFromArray($spec, $defaultOptions = true)
{
$parser = new ConsoleOptionParser($spec['command'], $defaultOptions);
$parser = new static($spec['command'], $defaultOptions);
if (!empty($spec['arguments'])) {
$parser->addArguments($spec['arguments']);
}
Expand Down Expand Up @@ -244,7 +244,7 @@ public function toArray()
* Get or set the command name for shell/task.
*
* @param array|\Cake\Console\ConsoleOptionParser $spec ConsoleOptionParser or spec to merge with.
* @return self
* @return $this
*/
public function merge($spec)
{
Expand Down Expand Up @@ -274,7 +274,7 @@ public function merge($spec)
* Sets the command name for shell/task.
*
* @param string $text The text to set.
* @return self
* @return $this
*/
public function setCommand($text)
{
Expand Down Expand Up @@ -314,7 +314,7 @@ public function command($text = null)
*
* @param string|array $text The text to set. If an array the
* text will be imploded with "\n".
* @return self
* @return $this
*/
public function setDescription($text)
{
Expand Down Expand Up @@ -359,7 +359,7 @@ public function description($text = null)
*
* @param string|array $text The text to set. If an array the text will
* be imploded with "\n".
* @return self
* @return $this
*/
public function setEpilog($text)
{
Expand Down Expand Up @@ -421,7 +421,7 @@ public function epilog($text = null)
* @param \Cake\Console\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 self
* @return $this
*/
public function addOption($name, array $options = [])
{
Expand Down Expand Up @@ -454,7 +454,7 @@ public function addOption($name, array $options = [])
* Remove an option from the option parser.
*
* @param string $name The option name to remove.
* @return self
* @return $this
*/
public function removeOption($name)
{
Expand All @@ -479,7 +479,7 @@ public function removeOption($name)
* @param \Cake\Console\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 self
* @return $this
*/
public function addArgument($name, array $params = [])
{
Expand Down Expand Up @@ -519,7 +519,7 @@ public function addArgument($name, array $params = [])
*
* @param array $args Array of arguments to add.
* @see \Cake\Console\ConsoleOptionParser::addArgument()
* @return self
* @return $this
*/
public function addArguments(array $args)
{
Expand All @@ -540,7 +540,7 @@ public function addArguments(array $args)
*
* @param array $options Array of options to add.
* @see \Cake\Console\ConsoleOptionParser::addOption()
* @return self
* @return $this
*/
public function addOptions(array $options)
{
Expand Down Expand Up @@ -568,7 +568,7 @@ public function addOptions(array $options)
*
* @param \Cake\Console\ConsoleInputSubcommand|string $name Name of the subcommand. Will also accept an instance of ConsoleInputSubcommand
* @param array $options Array of params, see above.
* @return self
* @return $this
*/
public function addSubcommand($name, array $options = [])
{
Expand Down Expand Up @@ -624,7 +624,7 @@ protected function _mergeSubcommandHelpToParserDescription($options)
* Remove a subcommand from the option parser.
*
* @param string $name The subcommand name to remove.
* @return self
* @return $this
*/
public function removeSubcommand($name)
{
Expand All @@ -637,7 +637,7 @@ public function removeSubcommand($name)
* Add multiple subcommands at once.
*
* @param array $commands Array of subcommands.
* @return self
* @return $this
*/
public function addSubcommands(array $commands)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Core/InstanceConfigTrait.php
Expand Up @@ -197,7 +197,7 @@ public function config($key = null, $value = null, $merge = true)
*
* @param string|array $key The key to set, or a complete array of configs.
* @param mixed|null $value The value to set.
* @return self The object itself.
* @return $this
*/
public function configShallow($key, $value = null)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Database/Connection.php
Expand Up @@ -149,7 +149,7 @@ public function configName()
* @param array $config Config for a new driver.
* @throws \Cake\Database\Exception\MissingDriverException When a driver class is missing.
* @throws \Cake\Database\Exception\MissingExtensionException When a driver's PHP extension is missing.
* @return self
* @return $this
*/
public function setDriver($driver, $config = [])
{
Expand Down Expand Up @@ -334,7 +334,7 @@ public function newQuery()
* Sets a Schema\Collection object for this connection.
*
* @param \Cake\Database\Schema\Collection $collection The schema collection object
* @return self
* @return $this
*/
public function setSchemaCollection(SchemaCollection $collection)
{
Expand Down Expand Up @@ -521,7 +521,7 @@ public function rollback()
* `$connection->enableSavePoints(false)` Disables usage of savepoints and returns false
*
* @param bool $enable Whether or not save points should be used.
* @return self
* @return $this
*/
public function enableSavePoints($enable)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Driver.php
Expand Up @@ -301,7 +301,7 @@ public function isConnected()
* in queries.
*
* @param bool $enable Whether to enable auto quoting
* @return self
* @return $this
*/
public function enableAutoQuoting($enable = true)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Expression/CaseExpression.php
Expand Up @@ -83,7 +83,7 @@ public function __construct($conditions = [], $values = [], $types = [])
* @param array|\Cake\Database\ExpressionInterface $values associative array of values of each condition
* @param array $types associative array of types to be associated with the values
*
* @return self
* @return $this
*/
public function add($conditions = [], $values = [], $types = [])
{
Expand Down
4 changes: 2 additions & 2 deletions src/Database/Expression/FunctionExpression.php
Expand Up @@ -77,7 +77,7 @@ public function __construct($name, $params = [], $types = [], $returnType = 'str
* Sets the name of the SQL function to be invoke in this expression.
*
* @param string $name The name of the function
* @return self
* @return $this
*/
public function setName($name)
{
Expand Down Expand Up @@ -122,7 +122,7 @@ public function name($name = null)
* passed arguments
* @param bool $prepend Whether to prepend or append to the list of arguments
* @see \Cake\Database\Expression\FunctionExpression::__construct() for more details.
* @return self
* @return $this
*/
public function add($params, $types = [], $prepend = false)
{
Expand Down
42 changes: 21 additions & 21 deletions src/Database/Expression/QueryExpression.php
Expand Up @@ -77,7 +77,7 @@ public function __construct($conditions = [], $types = [], $conjunction = 'AND')
*
* @param string $conjunction Value to be used for joining conditions. If null it
* will not set any value, but return the currently stored one
* @return self
* @return $this
*/
public function setConjunction($conjunction)
{
Expand Down Expand Up @@ -145,7 +145,7 @@ public function type($conjunction = null)
* @param array $types associative array of fields pointing to the type of the
* values that are being passed. Used for correctly binding values to statements.
* @see \Cake\Database\Query::where() for examples on conditions
* @return self
* @return $this
*/
public function add($conditions, $types = [])
{
Expand Down Expand Up @@ -174,7 +174,7 @@ public function add($conditions, $types = [])
* @param string|null $type the type name for $value as configured using the Type map.
* If it is suffixed with "[]" and the value is an array then multiple placeholders
* will be created, one per each value in the array.
* @return self
* @return $this
*/
public function eq($field, $value, $type = null)
{
Expand All @@ -193,7 +193,7 @@ public function eq($field, $value, $type = null)
* @param string|null $type the type name for $value as configured using the Type map.
* If it is suffixed with "[]" and the value is an array then multiple placeholders
* will be created, one per each value in the array.
* @return self
* @return $this
*/
public function notEq($field, $value, $type = null)
{
Expand All @@ -210,7 +210,7 @@ public function notEq($field, $value, $type = null)
* @param string $field Database field to be compared against value
* @param mixed $value The value to be bound to $field for comparison
* @param string|null $type the type name for $value as configured using the Type map.
* @return self
* @return $this
*/
public function gt($field, $value, $type = null)
{
Expand All @@ -227,7 +227,7 @@ public function gt($field, $value, $type = null)
* @param string $field Database field to be compared against value
* @param mixed $value The value to be bound to $field for comparison
* @param string|null $type the type name for $value as configured using the Type map.
* @return self
* @return $this
*/
public function lt($field, $value, $type = null)
{
Expand All @@ -244,7 +244,7 @@ public function lt($field, $value, $type = null)
* @param string $field Database field to be compared against value
* @param mixed $value The value to be bound to $field for comparison
* @param string|null $type the type name for $value as configured using the Type map.
* @return self
* @return $this
*/
public function gte($field, $value, $type = null)
{
Expand All @@ -261,7 +261,7 @@ public function gte($field, $value, $type = null)
* @param string $field Database field to be compared against value
* @param mixed $value The value to be bound to $field for comparison
* @param string|null $type the type name for $value as configured using the Type map.
* @return self
* @return $this
*/
public function lte($field, $value, $type = null)
{
Expand All @@ -277,7 +277,7 @@ public function lte($field, $value, $type = null)
*
* @param string|\Cake\Database\ExpressionInterface $field database field to be
* tested for null
* @return self
* @return $this
*/
public function isNull($field)
{
Expand All @@ -293,7 +293,7 @@ public function isNull($field)
*
* @param string|\Cake\Database\ExpressionInterface $field database field to be
* tested for not null
* @return self
* @return $this
*/
public function isNotNull($field)
{
Expand All @@ -310,7 +310,7 @@ public function isNotNull($field)
* @param string $field Database field to be compared against value
* @param mixed $value The value to be bound to $field for comparison
* @param string|null $type the type name for $value as configured using the Type map.
* @return self
* @return $this
*/
public function like($field, $value, $type = null)
{
Expand All @@ -327,7 +327,7 @@ public function like($field, $value, $type = null)
* @param string $field Database field to be compared against value
* @param mixed $value The value to be bound to $field for comparison
* @param string|null $type the type name for $value as configured using the Type map.
* @return self
* @return $this
*/
public function notLike($field, $value, $type = null)
{
Expand All @@ -345,7 +345,7 @@ public function notLike($field, $value, $type = null)
* @param string $field Database field to be compared against value
* @param string|array $values the value to be bound to $field for comparison
* @param string|null $type the type name for $value as configured using the Type map.
* @return self
* @return $this
*/
public function in($field, $values, $type = null)
{
Expand All @@ -368,7 +368,7 @@ public function in($field, $values, $type = null)
* passed in $conditions. If there are more $values than $conditions, the last $value is used as the `ELSE` value
* @param array $types associative array of types to be associated with the values
* passed in $values
* @return self
* @return $this
*/
public function addCase($conditions, $values = [], $types = [])
{
Expand All @@ -382,7 +382,7 @@ public function addCase($conditions, $values = [], $types = [])
* @param string $field Database field to be compared against value
* @param array $values the value to be bound to $field for comparison
* @param string|null $type the type name for $value as configured using the Type map.
* @return self
* @return $this
*/
public function notIn($field, $values, $type = null)
{
Expand All @@ -400,7 +400,7 @@ public function notIn($field, $values, $type = null)
* Adds a new condition to the expression object in the form "EXISTS (...)".
*
* @param \Cake\Database\ExpressionInterface $query the inner query
* @return self
* @return $this
*/
public function exists(ExpressionInterface $query)
{
Expand All @@ -411,7 +411,7 @@ public function exists(ExpressionInterface $query)
* Adds a new condition to the expression object in the form "NOT EXISTS (...)".
*
* @param \Cake\Database\ExpressionInterface $query the inner query
* @return self
* @return $this
*/
public function notExists(ExpressionInterface $query)
{
Expand All @@ -426,7 +426,7 @@ public function notExists(ExpressionInterface $query)
* @param mixed $from The initial value of the range.
* @param mixed $to The ending value in the comparison range.
* @param string|null $type the type name for $value as configured using the Type map.
* @return self
* @return $this
*/
public function between($field, $from, $to, $type = null)
{
Expand Down Expand Up @@ -484,7 +484,7 @@ public function or_($conditions, $types = [])
* @param string|array|\Cake\Database\Expression\QueryExpression $conditions to be added and negated
* @param array $types associative array of fields pointing to the type of the
* values that are being passed. Used for correctly binding values to statements.
* @return self
* @return $this
*/
public function not($conditions, $types = [])
{
Expand All @@ -508,7 +508,7 @@ public function count()
*
* @param string $left Left join condition field name.
* @param string $right Right join condition field name.
* @return self
* @return $this
*/
public function equalFields($left, $right)
{
Expand Down Expand Up @@ -589,7 +589,7 @@ public function traverse(callable $callable)
* modified part is stored.
*
* @param callable $callable The callable to apply to each part.
* @return self
* @return $this
*/
public function iterateParts(callable $callable)
{
Expand Down

0 comments on commit cd379b2

Please sign in to comment.