Browse Source

Fix errors reported by phpstan in ORM package

ADmad 8 years ago
parent
commit
c757ee1f4f
3 changed files with 3 additions and 2 deletions
  1. 1 0
      phpstan.neon
  2. 1 1
      src/ORM/Association/BelongsToMany.php
  3. 1 1
      src/ORM/EagerLoader.php

+ 1 - 0
phpstan.neon

@@ -22,6 +22,7 @@ parameters:
         - '#Access to an undefined property Psr\\Http\\Message\\UriInterface::\$webroot#'
         - '#Access to an undefined property Psr\\Http\\Message\\UriInterface::\$base#'
         - '#Call to an undefined method Cake\\Collection\\Iterator\\ZipIterator::getInnerIterator\(\)#'
+        - '#Call to an undefined method Cake\\ORM\\ResultSet::getInnerIterator\(\)#'
         - '#Result of method Cake\\Http\\Response::send\(\) \(void\) is used#'
         - '#Method Cake\\View\\Form\\ContextInterface::val\(\) invoked with 2 parameters, 1 required#'
         - '#Access to an undefined property Exception::\$queryString#'

+ 1 - 1
src/ORM/Association/BelongsToMany.php

@@ -510,7 +510,7 @@ class BelongsToMany extends Association
         $subquery = $this->_appendJunctionJoin($subquery, $conditions);
 
         $query
-            ->andWhere(function ($exp) use ($subquery, $conds) {
+            ->where(function ($exp) use ($subquery, $conds) {
                 $identifiers = [];
                 foreach (array_keys($conds) as $field) {
                     $identifiers = new IdentifierExpression($field);

+ 1 - 1
src/ORM/EagerLoader.php

@@ -813,7 +813,7 @@ class EagerLoader
      * Helper function used to iterate a statement and extract the columns
      * defined in $collectKeys
      *
-     * @param \Cake\Database\BufferedStatement $statement The statement to read from.
+     * @param \Cake\Database\Statement\BufferedStatement $statement The statement to read from.
      * @param array $collectKeys The keys to collect
      * @return array
      */