Jyxo\Spl\CountableLimitIterator::count PHP Метод

count() публичный Метод

Returns number of items based on result counting mode (all inner or final count after applying limit).
public count ( ) : integer
Результат integer
    public function count() : int
    {
        $count = count($this->getInnerIterator());
        if (self::MODE_LIMIT === $this->mode) {
            // We want real number of results - after applying limit
            if (0 !== $this->offset) {
                // Offset from beginning
                $count -= $this->offset;
            }
            if (-1 !== $this->count && $count > $this->count) {
                // Maximum number of items
                $count = $this->count;
            }
            if ($count < 0) {
                // We moved after end of inner iterator - offset is higher than count($this->getInnerIterator())
                $count = 0;
            }
        }
        return $count;
    }
CountableLimitIterator