Browse Source

Merge pull request #16788 from cakephp/5.x-resultset

Drop unneeded method.
othercorey 3 years ago
parent
commit
539c0d813a
2 changed files with 1 additions and 10 deletions
  1. 0 10
      src/Collection/Collection.php
  2. 1 0
      src/ORM/ResultSet.php

+ 0 - 10
src/Collection/Collection.php

@@ -67,16 +67,6 @@ class Collection extends IteratorIterator implements CollectionInterface
     }
 
     /**
-     * {@inheritDoc}
-     *
-     * @return int
-     */
-    public function countKeys(): int
-    {
-        return count($this->toArray());
-    }
-
-    /**
      * Returns an array that can be used to describe the internal state of this
      * object.
      *

+ 1 - 0
src/ORM/ResultSet.php

@@ -185,6 +185,7 @@ class ResultSet implements ResultSetInterface
      */
     public function countKeys(): int
     {
+        // This is an optimization over the implementation provided by CollectionTrait::countKeys()
         return $this->_count;
     }