Browse Source

Fix CS error in I18n, Network, Routing, Utility, View packages.

ADmad 11 years ago
parent
commit
82b3cafaa3

+ 1 - 1
src/I18n/I18n.php

@@ -207,7 +207,7 @@ class I18n
      * locale as stored in the `intl.default_locale` PHP setting.
      *
      * @param string|null $locale The name of the locale to set as default.
-     * @return string|null The name of the default locale.
+     * @return string|void The name of the default locale.
      */
     public static function locale($locale = null)
     {

+ 1 - 1
src/I18n/Parser/PoFileParser.php

@@ -122,7 +122,7 @@ class PoFileParser
     /**
      * Saves a translation item to the messages.
      *
-     * @param array &$messages The messages array being collected from the file
+     * @param array $messages The messages array being collected from the file
      * @param array $item The current item being inspected
      * @return void
      */

+ 1 - 1
src/I18n/TranslatorRegistry.php

@@ -130,7 +130,7 @@ class TranslatorRegistry extends TranslatorLocator
      *
      * @param string $name The name of the translator package to register a loader for
      * @param callable $loader A callable object that should return a Package
-     * @return \Aura\Intl\TranslatorInterface A translator object.
+     * @return void
      */
     public function registerLoader($name, callable $loader)
     {

+ 6 - 6
src/I18n/functions.php

@@ -69,7 +69,7 @@ if (!function_exists('__d')) {
      * @param string $domain Domain.
      * @param string $msg String to translate.
      * @param mixed $args Array with arguments or multiple arguments in function.
-     * @return string Translated string.
+     * @return void|string Translated string.
      * @link http://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__d
      */
     function __d($domain, $msg, $args = null)
@@ -94,7 +94,7 @@ if (!function_exists('__dn')) {
      * @param string $plural Plural.
      * @param int $count Count.
      * @param mixed $args Array with arguments or multiple arguments in function.
-     * @return string Plural form of translated string.
+     * @return void|string Plural form of translated string.
      * @link http://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__dn
      */
     function __dn($domain, $singular, $plural, $count, $args = null)
@@ -121,7 +121,7 @@ if (!function_exists('__x')) {
      * @param string $context Context of the text.
      * @param string $singular Text to translate.
      * @param mixed $args Array with arguments or multiple arguments in function.
-     * @return mixed Translated string.
+     * @return void|string Translated string.
      * @link http://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__
      */
     function __x($context, $singular, $args = null)
@@ -148,7 +148,7 @@ if (!function_exists('__xn')) {
      * @param string $plural Plural text.
      * @param int $count Count.
      * @param mixed $args Array with arguments or multiple arguments in function.
-     * @return mixed Plural form of translated string.
+     * @return void|string Plural form of translated string.
      * @link http://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__xn
      */
     function __xn($context, $singular, $plural, $count, $args = null)
@@ -176,7 +176,7 @@ if (!function_exists('__dx')) {
      * @param string $context Context of the text.
      * @param string $msg String to translate.
      * @param mixed $args Array with arguments or multiple arguments in function.
-     * @return string Translated string.
+     * @return void|string Translated string.
      * @link http://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__dx
      */
     function __dx($domain, $context, $msg, $args = null)
@@ -207,7 +207,7 @@ if (!function_exists('__dxn')) {
      * @param string $plural Plural text.
      * @param int $count Count.
      * @param mixed $args Array with arguments or multiple arguments in function.
-     * @return mixed Plural form of translated string.
+     * @return void|string Plural form of translated string.
      * @link http://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__dxn
      */
     function __dxn($domain, $context, $singular, $plural, $count, $args = null)

+ 2 - 1
src/Network/Email/Email.php

@@ -1995,7 +1995,8 @@ class Email implements JsonSerializable, Serializable
     /**
      * Unserializes the Email object.
      *
-     * @return void.
+     * @param string $data Serialized string.
+     * @return \Cake\Network\Email\Email Configured email instance.
      */
     public function unserialize($data)
     {

+ 1 - 1
src/Network/Session.php

@@ -480,7 +480,7 @@ class Session
     /**
      * Used to write new data to _SESSION, since PHP doesn't like us setting the _SESSION var itself.
      *
-     * @param array &$old Set of old variables => values
+     * @param array $old Set of old variables => values
      * @param array $new New set of variable => value
      * @return void
      */

+ 1 - 1
src/Routing/RouteBuilder.php

@@ -242,7 +242,7 @@ class RouteBuilder
      * @param array|callable $options Options to use when generating REST routes, or a callback.
      * @param callable|null $callback An optional callback to be executed in a nested scope. Nested
      *   scopes inherit the existing path and 'id' parameter.
-     * @return array Array of mapped resources
+     * @return void
      */
     public function resources($name, $options = [], $callback = null)
     {

+ 8 - 4
src/Routing/Router.php

@@ -304,18 +304,22 @@ class Router
             if ($plugin && $prefix) {
                 $path = '/' . implode('/', [$prefix, $pluginUrl]);
                 $params = ['prefix' => $prefix, 'plugin' => $plugin];
-                return static::scope($path, $params, $callback);
+                static::scope($path, $params, $callback);
+                return;
             }
 
             if ($prefix) {
-                return static::prefix($prefix, $callback);
+                static::prefix($prefix, $callback);
+                return;
             }
 
             if ($plugin) {
-                return static::plugin($plugin, $callback);
+                static::plugin($plugin, $callback);
+                return;
             }
 
-            return static::scope('/', $callback);
+            static::scope('/', $callback);
+            return;
         }
     }
 

+ 2 - 2
src/Utility/Hash.php

@@ -486,7 +486,7 @@ class Hash
      * @param array $data Source array from which to extract the data
      * @param array $paths An array containing one or more Hash::extract()-style key paths
      * @param string $format Format string into which values will be inserted, see sprintf()
-     * @return array An array of strings extracted from `$path` and formatted with `$format`
+     * @return void|array An array of strings extracted from `$path` and formatted with `$format`
      * @link http://book.cakephp.org/3.0/en/core-libraries/hash.html#Hash::format
      * @see sprintf()
      * @see Hash::extract()
@@ -719,7 +719,7 @@ class Hash
      * Merge helper function to reduce duplicated code between merge() and expand().
      *
      * @param array $stack The stack of operations to work with.
-     * @param array &$return The return value to operate on.
+     * @param array $return The return value to operate on.
      * @return void
      */
     protected static function _merge($stack, &$return)

+ 2 - 2
src/Utility/Xml.php

@@ -224,7 +224,7 @@ class Xml
      *
      * @param \DOMDocument $dom Handler to DOMDocument
      * @param \DOMElement $node Handler to DOMElement (child)
-     * @param array &$data Array of data to append to the $node.
+     * @param array $data Array of data to append to the $node.
      * @param string $format Either 'attribute' or 'tags'. This determines where nested keys go.
      * @return void
      * @throws \Cake\Utility\Exception\XmlException
@@ -356,7 +356,7 @@ class Xml
      * Recursive method to toArray
      *
      * @param \SimpleXMLElement $xml SimpleXMLElement object
-     * @param array &$parentData Parent array with data
+     * @param array $parentData Parent array with data
      * @param string $ns Namespace of current child
      * @param array $namespaces List of namespaces in XML
      * @return void

+ 1 - 1
src/View/Helper/FlashHelper.php

@@ -60,7 +60,7 @@ class FlashHelper extends Helper
      * @param string $key The [Flash.]key you are rendering in the view.
      * @param array $options Additional options to use for the creation of this flash message.
      *    Supports the 'params', and 'element' keys that are used in the helper.
-     * @return string|null Rendered flash message or null if flash key does not exist
+     * @return string|void Rendered flash message or null if flash key does not exist
      *   in session.
      * @throws \UnexpectedValueException If value for flash settings key is not an array.
      */

+ 1 - 1
src/View/Helper/FormHelper.php

@@ -536,7 +536,7 @@ class FormHelper extends Helper
      *    generating the hash, else $this->fields is being used.
      * @param array $secureAttributes will be passed as HTML attributes into the hidden
      *    input elements generated for the Security Component.
-     * @return string A hidden input field with a security hash
+     * @return void|string A hidden input field with a security hash
      */
     public function secure(array $fields = [], array $secureAttributes = [])
     {

+ 1 - 1
src/View/View.php

@@ -446,7 +446,7 @@ class View
      *
      * @param string|null $view Name of view file to use
      * @param string|null $layout Layout to use.
-     * @return string|null Rendered content or null if content already rendered and returned earlier.
+     * @return string|void Rendered content or null if content already rendered and returned earlier.
      * @throws \Cake\Core\Exception\Exception If there is an error in the view.
      * @triggers View.beforeRender $this, [$viewFileName]
      * @triggers View.afterRender $this, [$viewFileName]