Browse Source

Cleanup return types.

Mark Scherer 10 years ago
parent
commit
781fa5ee2d

+ 1 - 1
src/Auth/Storage/MemoryStorage.php

@@ -72,7 +72,7 @@ class MemoryStorage implements StorageInterface
 
         if ($url === false) {
             $this->_redirectUrl = null;
-            return;
+            return null;
         }
 
         $this->_redirectUrl = $url;

+ 1 - 1
src/Auth/Storage/SessionStorage.php

@@ -128,7 +128,7 @@ class SessionStorage implements StorageInterface
 
         if ($url === false) {
             $this->_session->delete($this->_config['redirect']);
-            return;
+            return null;
         }
 
         $this->_session->write($this->_config['redirect'], $url);

+ 2 - 2
src/Collection/CollectionTrait.php

@@ -382,7 +382,7 @@ trait CollectionTrait
 
             if (!($options['groupPath'])) {
                 $mapReduce->emit($rowVal($value, $key), $rowKey($value, $key));
-                return;
+                return null;
             }
 
             $key = $options['groupPath']($value, $key);
@@ -433,7 +433,7 @@ trait CollectionTrait
                     $parents[$id] = $isObject ? $parents[$id] : new ArrayIterator($parents[$id], 1);
                     $mapReduce->emit($parents[$id]);
                 }
-                return;
+                return null;
             }
 
             $children = [];

+ 1 - 1
src/Controller/Component/AuthComponent.php

@@ -783,7 +783,7 @@ class AuthComponent extends Component
     public function constructAuthenticate()
     {
         if (empty($this->_config['authenticate'])) {
-            return;
+            return null;
         }
         $this->_authenticateObjects = [];
         $authenticate = Hash::normalize((array)$this->_config['authenticate']);

+ 1 - 1
src/Controller/Controller.php

@@ -539,7 +539,7 @@ class Controller implements EventListenerInterface, EventDispatcherInterface
             return $event->result;
         }
         if ($event->isStopped()) {
-            return;
+            return null;
         }
 
         if (!$response->location()) {

+ 1 - 1
src/Database/Type.php

@@ -133,7 +133,7 @@ class Type
         }
         if (!is_string($type)) {
             self::$_types = $type;
-            return;
+            return null;
         }
         if ($className === null) {
             return isset(self::$_types[$type]) ? self::$_types[$type] : null;

+ 1 - 1
src/ORM/Marshaller.php

@@ -223,7 +223,7 @@ class Marshaller
     protected function _marshalAssociation($assoc, $value, $options)
     {
         if (!is_array($value)) {
-            return;
+            return null;
         }
         $targetTable = $assoc->target();
         $marshaller = $targetTable->marshaller();

+ 3 - 3
src/View/Helper/HtmlHelper.php

@@ -416,7 +416,7 @@ class HtmlHelper extends Helper
      *   CSS stylesheets. If `$path` is prefixed with '/', the path will be relative to the webroot
      *   of your application. Otherwise, the path will be relative to your CSS path, usually webroot/css.
      * @param array $options Array of options and HTML arguments.
-     * @return string CSS <link /> or <style /> tag, depending on the type of link.
+     * @return string|null CSS <link /> or <style /> tag, depending on the type of link.
      * @link http://book.cakephp.org/3.0/en/views/helpers/html.html#linking-to-css-files
      */
     public function css($path, array $options = [])
@@ -431,7 +431,7 @@ class HtmlHelper extends Helper
             if (empty($options['block'])) {
                 return $out . "\n";
             }
-            return;
+            return null;
         }
 
         if (strpos($path, '//') !== false) {
@@ -442,7 +442,7 @@ class HtmlHelper extends Helper
         }
 
         if ($options['once'] && isset($this->_includedAssets[__METHOD__][$path])) {
-            return '';
+            return null;
         }
         unset($options['once']);
         $this->_includedAssets[__METHOD__][$path] = true;