Browse Source

Fix few errors reported by phpstan.

ADmad 8 years ago
parent
commit
aa23283a22
3 changed files with 4 additions and 3 deletions
  1. 2 2
      src/Database/Query.php
  2. 1 1
      src/Log/Engine/ConsoleLog.php
  3. 1 0
      src/ORM/LazyEagerLoader.php

+ 2 - 2
src/Database/Query.php

@@ -104,7 +104,7 @@ class Query implements ExpressionInterface, IteratorAggregate
      * The object responsible for generating query placeholders and temporarily store values
      * associated to each of those.
      *
-     * @var \Cake\Database\ValueBinder|false|null
+     * @var \Cake\Database\ValueBinder|null
      */
     protected $_valueBinder;
 
@@ -1870,7 +1870,7 @@ class Query implements ExpressionInterface, IteratorAggregate
      * to the statement object.
      *
      * @deprecated 3.5.0 Use getValueBinder() for the getter part instead.
-     * @param \Cake\Database\ValueBinder|false|null $binder new instance to be set. If no value is passed the
+     * @param \Cake\Database\ValueBinder|null $binder new instance to be set. If no value is passed the
      *   default one will be returned
      * @return $this|\Cake\Database\ValueBinder
      */

+ 1 - 1
src/Log/Engine/ConsoleLog.php

@@ -91,6 +91,6 @@ class ConsoleLog extends BaseLog
         $message = $this->_format($message, $context);
         $output = date('Y-m-d H:i:s') . ' ' . ucfirst($level) . ': ' . $message;
 
-        return $this->_output->write(sprintf('<%s>%s</%s>', $level, $output, $level));
+        return (bool)$this->_output->write(sprintf('<%s>%s</%s>', $level, $output, $level));
     }
 }

+ 1 - 0
src/ORM/LazyEagerLoader.php

@@ -76,6 +76,7 @@ class LazyEagerLoader
             return $entity->{$method}($primaryKey);
         });
 
+        /** @var \Cake\ORM\Query $query */
         $query = $source
             ->find()
             ->select((array)$primaryKey)