Browse Source

Fix up return self to $this for chainable.

dereuromark 9 years ago
parent
commit
ab96da0ca4

+ 3 - 3
src/Console/ConsoleOptionParser.php

@@ -298,7 +298,7 @@ class ConsoleOptionParser
      *
      * @deprecated 3.4.0 Use setCommand()/getCommand() instead.
      * @param string|null $text The text to set, or null if you want to read
-     * @return string|self If reading, the value of the command. If setting $this will be returned.
+     * @return string|$this If reading, the value of the command. If setting $this will be returned.
      */
     public function command($text = null)
     {
@@ -342,7 +342,7 @@ class ConsoleOptionParser
      * @deprecated 3.4.0 Use setDescription()/getDescription() instead.
      * @param string|array|null $text The text to set, or null if you want to read. If an array the
      *   text will be imploded with "\n".
-     * @return string|self If reading, the value of the description. If setting $this will be returned.
+     * @return string|$this If reading, the value of the description. If setting $this will be returned.
      */
     public function description($text = null)
     {
@@ -388,7 +388,7 @@ class ConsoleOptionParser
      * @deprecated 3.4.0 Use setEpilog()/getEpilog() instead.
      * @param string|array|null $text Text when setting or null when reading. If an array the text will
      *   be imploded with "\n".
-     * @return string|self If reading, the value of the epilog. If setting $this will be returned.
+     * @return string|$this If reading, the value of the epilog. If setting $this will be returned.
      */
     public function epilog($text = null)
     {

+ 1 - 1
src/Database/Expression/FunctionExpression.php

@@ -102,7 +102,7 @@ class FunctionExpression extends QueryExpression implements TypedResultInterface
      *
      * @deprecated 3.4.0 Use setName()/getName() instead.
      * @param string|null $name The name of the function
-     * @return string|self
+     * @return string|$this
      */
     public function name($name = null)
     {

+ 2 - 2
src/Database/Expression/QueryExpression.php

@@ -103,7 +103,7 @@ class QueryExpression implements ExpressionInterface, Countable
      * @deprecated 3.4.0 Use setConjunction()/getConjunction() instead.
      * @param string|null $conjunction value to be used for joining conditions. If null it
      * will not set any value, but return the currently stored one
-     * @return string|self
+     * @return string|$this
      */
     public function tieWith($conjunction = null)
     {
@@ -119,7 +119,7 @@ class QueryExpression implements ExpressionInterface, Countable
      *
      * @param string|null $conjunction value to be used for joining conditions. If null it
      * will not set any value, but return the currently stored one
-     * @return string|self
+     * @return string|$this
      * @deprecated 3.2.0 Use tieWith() instead
      */
     public function type($conjunction = null)

+ 3 - 3
src/Database/Expression/ValuesExpression.php

@@ -132,7 +132,7 @@ class ValuesExpression implements ExpressionInterface
      *
      * @deprecated 3.4.0 Use setColumns()/getColumns() instead.
      * @param array|null $cols Array with columns to be inserted.
-     * @return array|self
+     * @return array|$this
      */
     public function columns($cols = null)
     {
@@ -198,7 +198,7 @@ class ValuesExpression implements ExpressionInterface
      *
      * @deprecated 3.4.0 Use setValues()/getValues() instead.
      * @param array|null $values Array with values to be inserted.
-     * @return array|self
+     * @return array|$this
      */
     public function values($values = null)
     {
@@ -241,7 +241,7 @@ class ValuesExpression implements ExpressionInterface
      *
      * @deprecated 3.4.0 Use setQuery()/getQuery() instead.
      * @param \Cake\Database\Query|null $query The query to set
-     * @return \Cake\Database\Query|null|self
+     * @return \Cake\Database\Query|null|$this
      */
     public function query(Query $query = null)
     {

+ 1 - 1
src/Database/Query.php

@@ -1847,7 +1847,7 @@ class Query implements ExpressionInterface, IteratorAggregate
      *
      * @deprecated 3.4.0 Use enableBufferedResults()/isBufferedResultsEnabled() instead.
      * @param bool|null $enable Whether or not to enable buffering
-     * @return bool|self
+     * @return bool|$this
      */
     public function bufferResults($enable = null)
     {

+ 1 - 1
src/Database/TypedResultInterface.php

@@ -25,7 +25,7 @@ interface TypedResultInterface
      * If called without arguments, returns the current known type
      *
      * @param string|null $type The name of the type that is to be returned
-     * @return string|self
+     * @return string|$this
      */
     public function returnType($type = null);
 }

+ 1 - 1
src/Database/TypedResultTrait.php

@@ -32,7 +32,7 @@ trait TypedResultTrait
      * If called without arguments, returns the current known type
      *
      * @param string|null $type The name of the type that is to be returned
-     * @return string|self
+     * @return string|$this
      */
     public function returnType($type = null)
     {

+ 4 - 4
src/Datasource/EntityTrait.php

@@ -405,7 +405,7 @@ trait EntityTrait
      * will be returned. Otherwise the hidden properties will be set.
      *
      * @param null|array $properties Either an array of properties to hide or null to get properties
-     * @return array|self
+     * @return array|$this
      */
     public function hiddenProperties($properties = null)
     {
@@ -424,7 +424,7 @@ trait EntityTrait
      * will be returned. Otherwise the virtual properties will be set.
      *
      * @param null|array $properties Either an array of properties to treat as virtual or null to get properties
-     * @return array|self
+     * @return array|$this
      */
     public function virtualProperties($properties = null)
     {
@@ -757,7 +757,7 @@ trait EntityTrait
      * @param string|array|null $field The field to get errors for, or the array of errors to set.
      * @param string|array|null $errors The errors to be set for $field
      * @param bool $overwrite Whether or not to overwrite pre-existing errors for $field
-     * @return array|self
+     * @return array|$this
      */
     public function errors($field = null, $errors = null, $overwrite = false)
     {
@@ -971,7 +971,7 @@ trait EntityTrait
      * this entity came from if it is known.
      *
      * @param string|null $alias the alias of the repository
-     * @return string|self
+     * @return string|$this
      */
     public function source($alias = null)
     {

+ 1 - 1
src/Datasource/ModelAwareTrait.php

@@ -134,7 +134,7 @@ trait ModelAwareTrait
      *
      * @param string|null $modelType The model type or null to retrieve the current
      *
-     * @return string|self
+     * @return string|$this
      */
     public function modelType($modelType = null)
     {

+ 1 - 1
src/Datasource/QueryInterface.php

@@ -255,7 +255,7 @@ interface QueryInterface
      * that is, the repository that will appear in the from clause.
      *
      * @param \Cake\Datasource\RepositoryInterface|null $repository The default repository object to use
-     * @return \Cake\Datasource\RepositoryInterface|self
+     * @return \Cake\Datasource\RepositoryInterface|$this
      */
     public function repository(RepositoryInterface $repository = null);
 

+ 1 - 1
src/Datasource/QueryTrait.php

@@ -88,7 +88,7 @@ trait QueryTrait
      * and this query object will be returned for chaining.
      *
      * @param \Cake\Datasource\RepositoryInterface|null $table The default table object to use
-     * @return \Cake\Datasource\RepositoryInterface|self
+     * @return \Cake\Datasource\RepositoryInterface|$this
      */
     public function repository(RepositoryInterface $table = null)
     {

+ 2 - 2
src/Http/ServerRequest.php

@@ -1444,7 +1444,7 @@ class ServerRequest implements ArrayAccess, ServerRequestInterface
      *
      * @param string|null $name Dot separated name of the value to read/write
      * @param mixed ...$args The data to set (deprecated)
-     * @return mixed|self Either the value being read, or this so you can chain consecutive writes.
+     * @return mixed|$this Either the value being read, or this so you can chain consecutive writes.
      * @deprecated 3.4.0 Use withData() and getData() or getParsedBody() instead.
      */
     public function data($name = null, ...$args)
@@ -1498,7 +1498,7 @@ class ServerRequest implements ArrayAccess, ServerRequestInterface
      *
      * @param string $name The name of the parameter to get.
      * @param mixed ...$args Value to set (deprecated).
-     * @return mixed|self The value of the provided parameter. Will
+     * @return mixed|$this The value of the provided parameter. Will
      *   return false if the parameter doesn't exist or is falsey.
      * @deprecated 3.4.0 Use getParam() and withParam() instead.
      */

+ 21 - 21
src/Mailer/Email.php

@@ -390,7 +390,7 @@ class Email implements JsonSerializable, Serializable
      * @param string|array|null $email Null to get, String with email,
      *   Array with email as key, name as value or email as value (without name)
      * @param string|null $name Name
-     * @return array|self
+     * @return array|$this
      * @throws \InvalidArgumentException
      */
     public function from($email = null, $name = null)
@@ -433,7 +433,7 @@ class Email implements JsonSerializable, Serializable
      * @param string|array|null $email Null to get, String with email,
      *   Array with email as key, name as value or email as value (without name)
      * @param string|null $name Name
-     * @return array|self
+     * @return array|$this
      * @throws \InvalidArgumentException
      */
     public function sender($email = null, $name = null)
@@ -476,7 +476,7 @@ class Email implements JsonSerializable, Serializable
      * @param string|array|null $email Null to get, String with email,
      *   Array with email as key, name as value or email as value (without name)
      * @param string|null $name Name
-     * @return array|self
+     * @return array|$this
      * @throws \InvalidArgumentException
      */
     public function replyTo($email = null, $name = null)
@@ -519,7 +519,7 @@ class Email implements JsonSerializable, Serializable
      * @param string|array|null $email Null to get, String with email,
      *   Array with email as key, name as value or email as value (without name)
      * @param string|null $name Name
-     * @return array|self
+     * @return array|$this
      * @throws \InvalidArgumentException
      */
     public function readReceipt($email = null, $name = null)
@@ -562,7 +562,7 @@ class Email implements JsonSerializable, Serializable
      * @param string|array|null $email Null to get, String with email,
      *   Array with email as key, name as value or email as value (without name)
      * @param string|null $name Name
-     * @return array|self
+     * @return array|$this
      * @throws \InvalidArgumentException
      */
     public function returnPath($email = null, $name = null)
@@ -605,7 +605,7 @@ class Email implements JsonSerializable, Serializable
      * @param string|array|null $email Null to get, String with email,
      *   Array with email as key, name as value or email as value (without name)
      * @param string|null $name Name
-     * @return array|self
+     * @return array|$this
      */
     public function to($email = null, $name = null)
     {
@@ -659,7 +659,7 @@ class Email implements JsonSerializable, Serializable
      * @param string|array|null $email Null to get, String with email,
      *   Array with email as key, name as value or email as value (without name)
      * @param string|null $name Name
-     * @return array|self
+     * @return array|$this
      */
     public function cc($email = null, $name = null)
     {
@@ -713,7 +713,7 @@ class Email implements JsonSerializable, Serializable
      * @param string|array|null $email Null to get, String with email,
      *   Array with email as key, name as value or email as value (without name)
      * @param string|null $name Name
-     * @return array|self
+     * @return array|$this
      */
     public function bcc($email = null, $name = null)
     {
@@ -852,7 +852,7 @@ class Email implements JsonSerializable, Serializable
      * @param string|bool|null $regex The pattern to use for email address validation,
      *   null to unset the pattern and make use of filter_var() instead, false or
      *   nothing to return the current value
-     * @return string|self
+     * @return string|$this
      */
     public function emailPattern($regex = false)
     {
@@ -1001,7 +1001,7 @@ class Email implements JsonSerializable, Serializable
      *
      * @deprecated 3.4.0 Use setSubject()/getSubject() instead.
      * @param string|null $subject Subject string.
-     * @return string|self
+     * @return string|$this
      */
     public function subject($subject = null)
     {
@@ -1217,7 +1217,7 @@ class Email implements JsonSerializable, Serializable
      * @deprecated 3.4.0 Use setTemplate()/getTemplate() and setLayout()/getLayout() instead.
      * @param bool|string $template Template name or null to not use
      * @param bool|string $layout Layout name or null to not use
-     * @return array|self
+     * @return array|$this
      */
     public function template($template = false, $layout = false)
     {
@@ -1263,7 +1263,7 @@ class Email implements JsonSerializable, Serializable
      *
      * @deprecated 3.4.0 Use setViewRenderer()/getViewRenderer() instead.
      * @param string|null $viewClass View class name.
-     * @return string|self
+     * @return string|$this
      */
     public function viewRender($viewClass = null)
     {
@@ -1303,7 +1303,7 @@ class Email implements JsonSerializable, Serializable
      *
      * @deprecated 3.4.0 Use setViewVars()/getViewVars() instead.
      * @param array|null $viewVars Variables to set for view.
-     * @return array|self
+     * @return array|$this
      */
     public function viewVars($viewVars = null)
     {
@@ -1342,7 +1342,7 @@ class Email implements JsonSerializable, Serializable
      *
      * @deprecated 3.4.0 Use setTheme()/getTheme() instead.
      * @param string|null $theme Theme name.
-     * @return string|self
+     * @return string|$this
      */
     public function theme($theme = null)
     {
@@ -1381,7 +1381,7 @@ class Email implements JsonSerializable, Serializable
      *
      * @deprecated 3.4.0 Use setHelpers()/getHelpers() instead.
      * @param array|null $helpers Helpers list.
-     * @return array|self
+     * @return array|$this
      */
     public function helpers($helpers = null)
     {
@@ -1424,7 +1424,7 @@ class Email implements JsonSerializable, Serializable
      *
      * @deprecated 3.4.0 Use setEmailFormat()/getEmailFormat() instead.
      * @param string|null $format Formatting string.
-     * @return string|self
+     * @return string|$this
      * @throws \InvalidArgumentException
      */
     public function emailFormat($format = null)
@@ -1488,7 +1488,7 @@ class Email implements JsonSerializable, Serializable
      * @deprecated 3.4.0 Use setTransport()/getTransport() instead.
      * @param string|\Cake\Mailer\AbstractTransport|null $name Either the name of a configured
      *   transport, or a transport instance.
-     * @return \Cake\Mailer\AbstractTransport|self
+     * @return \Cake\Mailer\AbstractTransport|$this
      * @throws \LogicException When the chosen transport lacks a send method.
      * @throws \InvalidArgumentException When $name is neither a string nor an object.
      */
@@ -1584,7 +1584,7 @@ class Email implements JsonSerializable, Serializable
      *
      * @deprecated 3.4.0 Use setMessageId()/getMessageId() instead.
      * @param bool|string|null $message True to generate a new Message-ID, False to ignore (not send in email), String to set as Message-ID
-     * @return bool|string|self
+     * @return bool|string|$this
      * @throws \InvalidArgumentException
      */
     public function messageId($message = null)
@@ -1626,7 +1626,7 @@ class Email implements JsonSerializable, Serializable
      *
      * @deprecated 3.4.0 Use setDomain()/getDomain() instead.
      * @param string|null $domain Manually set the domain for CLI mailing
-     * @return string|self
+     * @return string|$this
      */
     public function domain($domain = null)
     {
@@ -1782,7 +1782,7 @@ class Email implements JsonSerializable, Serializable
      *
      * @deprecated 3.4.0 Use setAttachments()/getAttachments() instead.
      * @param string|array|null $attachments String with the filename or array with filenames
-     * @return array|self Either the array of attachments when getting or $this when setting.
+     * @return array|$this Either the array of attachments when getting or $this when setting.
      * @throws \InvalidArgumentException
      */
     public function attachments($attachments = null)
@@ -1978,7 +1978,7 @@ class Email implements JsonSerializable, Serializable
      * @deprecated 3.4.0 Use setProfile()/getProfile() instead.
      * @param null|string|array $config String with configuration name, or
      *    an array with config or null to return current config.
-     * @return string|array|self
+     * @return string|array|$this
      */
     public function profile($config = null)
     {

+ 4 - 4
src/ORM/Query.php

@@ -253,7 +253,7 @@ class Query extends DatabaseQuery implements JsonSerializable, QueryInterface
      * @deprecated 3.4.0 Use setEagerLoader()/getEagerLoader() instead.
      * @param \Cake\ORM\EagerLoader|null $instance The eager loader to use. Pass null
      *   to get the current eagerloader.
-     * @return \Cake\ORM\EagerLoader|self
+     * @return \Cake\ORM\EagerLoader|$this
      */
     public function eagerLoader(EagerLoader $instance = null)
     {
@@ -373,7 +373,7 @@ class Query extends DatabaseQuery implements JsonSerializable, QueryInterface
      * @param array|string|null $associations List of table aliases to be queried.
      * @param bool $override Whether override previous list with the one passed
      * defaults to merging previous list with the new one.
-     * @return array|self
+     * @return array|$this
      */
     public function contain($associations = null, $override = false)
     {
@@ -917,7 +917,7 @@ class Query extends DatabaseQuery implements JsonSerializable, QueryInterface
      * @deprecated 3.4.0 Use enableHydration()/isHydrationEnabled() instead.
      * @param bool|null $enable Use a boolean to set the hydration mode.
      *   Null will fetch the current hydration mode.
-     * @return bool|self A boolean when reading, and $this when setting the mode.
+     * @return bool|$this A boolean when reading, and $this when setting the mode.
      */
     public function hydrate($enable = null)
     {
@@ -1247,7 +1247,7 @@ class Query extends DatabaseQuery implements JsonSerializable, QueryInterface
      *
      * @deprecated 3.4.0 Use enableAutoFields()/isAutoFieldsEnabled() instead.
      * @param bool|null $value The value to set or null to read the current value.
-     * @return bool|self Either the current value or the query object.
+     * @return bool|$this Either the current value or the query object.
      */
     public function autoFields($value = null)
     {

+ 11 - 11
src/View/ViewBuilder.php

@@ -141,7 +141,7 @@ class ViewBuilder implements JsonSerializable, Serializable
      *
      * @deprecated 3.4.0 Use setTemplatePath()/getTemplatePath() instead.
      * @param string|null $path Path for view files. If null returns current path.
-     * @return string|self
+     * @return string|$this
      */
     public function templatePath($path = null)
     {
@@ -180,7 +180,7 @@ class ViewBuilder implements JsonSerializable, Serializable
      *
      * @deprecated 3.4.0 Use setLayoutPath()/getLayoutPath() instead.
      * @param string|null $path Path for layout files. If null returns current path.
-     * @return string|self
+     * @return string|$this
      */
     public function layoutPath($path = null)
     {
@@ -224,7 +224,7 @@ class ViewBuilder implements JsonSerializable, Serializable
      *
      * @deprecated 3.4.0 Use enableAutoLayout()/isAutoLayoutEnabled() instead.
      * @param bool|null $enable Boolean to turn on/off. If null returns current value.
-     * @return bool|self
+     * @return bool|$this
      */
     public function autoLayout($enable = null)
     {
@@ -267,7 +267,7 @@ class ViewBuilder implements JsonSerializable, Serializable
      * @deprecated 3.4.0 Use setPlugin()/getPlugin() instead.
      * @param string|null|false $name Plugin name. If null returns current plugin.
      *   Use false to remove the current plugin name.
-     * @return string|self
+     * @return string|$this
      */
     public function plugin($name = null)
     {
@@ -311,7 +311,7 @@ class ViewBuilder implements JsonSerializable, Serializable
      * @deprecated 3.4.0 Use setHelpers()/getHelpers() instead.
      * @param array|null $helpers Helpers to use.
      * @param bool $merge Whether or not to merge existing data with the new data.
-     * @return array|self
+     * @return array|$this
      */
     public function helpers(array $helpers = null, $merge = true)
     {
@@ -354,7 +354,7 @@ class ViewBuilder implements JsonSerializable, Serializable
      * @deprecated 3.4.0 Use setTheme()/getTheme() instead.
      * @param string|null|false $theme Theme name. If null returns current theme.
      *   Use false to remove the current theme.
-     * @return string|self
+     * @return string|$this
      */
     public function theme($theme = null)
     {
@@ -396,7 +396,7 @@ class ViewBuilder implements JsonSerializable, Serializable
      *
      * @deprecated 3.4.0 Use setTemplate()/getTemplate()
      * @param string|null $name View file name to set. If null returns current name.
-     * @return string|self
+     * @return string|$this
      */
     public function template($name = null)
     {
@@ -439,7 +439,7 @@ class ViewBuilder implements JsonSerializable, Serializable
      *
      * @deprecated 3.4.0 Use setLayout()/getLayout() instead.
      * @param string|null $name Layout file name to set. If null returns current name.
-     * @return string|self
+     * @return string|$this
      */
     public function layout($name = null)
     {
@@ -487,7 +487,7 @@ class ViewBuilder implements JsonSerializable, Serializable
      * @deprecated 3.4.0 Use setOptions()/getOptions() instead.
      * @param array|null $options Either an array of options or null to get current options.
      * @param bool $merge Whether or not to merge existing data with the new data.
-     * @return array|self
+     * @return array|$this
      */
     public function options(array $options = null, $merge = true)
     {
@@ -526,7 +526,7 @@ class ViewBuilder implements JsonSerializable, Serializable
      *
      * @deprecated 3.4.0 Use setName()/getName() instead.
      * @param string|null $name The name of the view
-     * @return string|self
+     * @return string|$this
      */
     public function name($name = null)
     {
@@ -573,7 +573,7 @@ class ViewBuilder implements JsonSerializable, Serializable
      * @param string|null $name The class name for the view. Can
      *   be a plugin.class name reference, a short alias, or a fully
      *   namespaced name.
-     * @return string|self
+     * @return string|$this
      */
     public function className($name = null)
     {