Browse Source

Fix CS errors in Console, Controller, Core, Database, Event, ORM packages.

ADmad 11 years ago
parent
commit
17dddccc68

+ 1 - 1
src/Console/ConsoleIo.php

@@ -175,7 +175,7 @@ class ConsoleIo
      * @param int $newlines Number of newlines to append.
      * @param int $size The number of bytes to overwrite. Defaults to the
      *    length of the last message output.
-     * @return int|bool Returns the number of bytes returned from writing to stdout.
+     * @return void
      */
     public function overwrite($message, $newlines = 1, $size = null)
     {

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

@@ -94,7 +94,7 @@ class SecurityComponent extends Component
      * Component startup. All security checking happens here.
      *
      * @param Event $event An Event instance
-     * @return void
+     * @return mixed
      */
     public function startup(Event $event)
     {

+ 1 - 1
src/Controller/ComponentRegistry.php

@@ -99,7 +99,7 @@ class ComponentRegistry extends ObjectRegistry
      * @param string $class The classname to create.
      * @param string $alias The alias of the component.
      * @param array $config An array of config to use for the component.
-     * @return Component The constructed component class.
+     * @return \Cake\Controller\Component The constructed component class.
      */
     protected function _create($class, $alias, $config)
     {

+ 2 - 1
src/Core/InstanceConfigTrait.php

@@ -163,7 +163,8 @@ trait InstanceConfigTrait
     protected function _configWrite($key, $value, $merge = false)
     {
         if (is_string($key) && $value === null) {
-            return $this->_configDelete($key);
+            $this->_configDelete($key);
+            return;
         }
 
         if ($merge) {

+ 1 - 1
src/Datasource/QueryCacher.php

@@ -71,7 +71,7 @@ class QueryCacher
      *
      * @param object $query The query the cache read is for.
      * @param \Traversable $results The result set to store.
-     * @return void
+     * @return bool True if the data was successfully cached, false on failure
      */
     public function store($query, Traversable $results)
     {

+ 12 - 7
src/Event/EventManager.php

@@ -100,12 +100,14 @@ class EventManager
     public function attach($callable, $eventKey = null, array $options = [])
     {
         if ($eventKey === null) {
-            return $this->on($callable);
+            $this->on($callable);
+            return;
         }
         if ($options) {
-            return $this->on($eventKey, $options, $callable);
+            $this->on($eventKey, $options, $callable);
+            return;
         }
-        return $this->on($eventKey, $callable);
+        $this->on($eventKey, $callable);
     }
 
     /**
@@ -227,9 +229,10 @@ class EventManager
     public function detach($callable, $eventKey = null)
     {
         if ($eventKey === null) {
-            return $this->off($callable);
+            $this->off($callable);
+            return;
         }
-        return $this->off($eventKey, $callable);
+        $this->off($eventKey, $callable);
     }
 
     /**
@@ -267,10 +270,12 @@ class EventManager
     public function off($eventKey, $callable = null)
     {
         if ($eventKey instanceof EventListenerInterface) {
-            return $this->_detachSubscriber($eventKey);
+            $this->_detachSubscriber($eventKey);
+            return;
         }
         if ($callable instanceof EventListenerInterface) {
-            return $this->_detachSubscriber($callable, $eventKey);
+            $this->_detachSubscriber($callable, $eventKey);
+            return;
         }
         if ($callable === null) {
             foreach (array_keys($this->_listeners) as $name) {

+ 1 - 1
src/ORM/Query.php

@@ -653,7 +653,7 @@ class Query extends DatabaseQuery implements JsonSerializable
      * using `contain`
      *
      * @see \Cake\Database\Query::execute()
-     * @return $this
+     * @return void
      */
     protected function _transformQuery()
     {

+ 2 - 2
src/ORM/TableRegistry.php

@@ -147,11 +147,11 @@ class TableRegistry
      * If no `connection` option is passed the table's defaultConnectionName() method
      * will be called to get the default connection name to use.
      *
-     * @param string $name The alias name you want to get.
+     * @param string $alias The alias name you want to get.
      * @param array $options The options you want to build the table with.
      *   If a table has already been loaded the options will be ignored.
      * @return \Cake\ORM\Table
-     * @throws RuntimeException When you try to configure an alias that already exists.
+     * @throws \RuntimeException When you try to configure an alias that already exists.
      */
     public static function get($alias, array $options = [])
     {