Drop unneeded method.
@@ -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.
*
@@ -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;