@param int $count

@return array
347420
public function iterNextPage($count = 3)
    {
        if ($this->getPage() == 1 && $this->getPagesCount() >= $count * 2) {
            $count *= 2;
        }
        $pages = [];
        foreach (range(1, $count) as $i) {
            $page = $this->getPage() + $i;
            if ($page <= $this->getPagesCount()) {
                $pages[] = $page;
            }
        }

        return $pages;
    }
777972
protected function emptyFinal($count)
    {
        $returnValue = array();

        while ($count > 0) {
            $returnValue[] = array_pop($this->final);
            $count--;
        }

        return array_reverse($returnValue);
    }
785332
public function limit( $count = null ) {
			
			if ( null === $count || is_int( $count ) ) {
			
				if ( null !== $count && $count >= 0 ) {
					
					return $count === $this->len
						? $this
						: new static( array_slice( $this->items, 0, $count ) );
				
				} else
				if ( $many === null || $many === -1 ) {
				
					return $this;
				
				} else {
				
					throw new \browserfs\Exception('Invalid argument $count: Expected int[-1..length] | null' );
				
				}
			} else {

				throw new \browserfs\Exception('Invalid argument $count: Expected int[-1..length] | null');
			
			}

		}
425685
public function stream_read($count) {
    assert(isset($this->client));
    return $this->client->read($count);
  }
1098709
public function hasExactCountOfObjects($count): bool
    {
        $this->collectObjects(true);

        return $this->getCountOfObjectsInCollection() === (int)$count;
    }
345247
public function read($count = 0)
    {
        if (0 === $count) {
            $count = -1;
        }
        fseek($this->resource, $this->readPosition);
        $content = stream_get_contents($this->resource, $count);
        $this->readPosition = ftell($this->resource);
        return $content;
    }
1348150
public function getCellsList($offset, $count)
    {
        //check whether workshett name is set or not
        if ($this->worksheetName == '')
            throw new Exception('Worksheet name not specified');
        $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() .
            '/worksheets/' . $this->worksheetName . '/cells?offset=' .
            $offset . '&count=' . $count;
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');
        $json = json_decode($responseStream);
        $listCells = array();
        foreach ($json->Cells->CellList as $cell) {
            $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() .
                '/worksheets/' . $this->worksheetName . '/cells' . $cell->link->Href;
            $signedURI = Utils::sign($strURI);
            $responseStream = Utils::processCommand($signedURI, 'GET', '', '');
            $json = json_decode($responseStream);
            array_push($listCells, $json->Cell);
        }
        return $listCells;

    }
705546
public function take($count)
    {
        if ($count == 0) {
            return new Linq([]);
        }
        $innerIterator = $this->iterator;
        if (!($innerIterator instanceof \Iterator)) {
            // IteratorIterator wraps $this->iterator because it is Traversable but not an Iterator.
            // (see https://bugs.php.net/bug.php?id=52280)
            $innerIterator = new \IteratorIterator($innerIterator);
        }

        return new Linq(new \LimitIterator($innerIterator, 0, $count));
    }
688406
public function getBytes($count)
    {
        $count = (int) $count;

        if ($count < 0) {
            throw new \InvalidArgumentException('Number of bytes must be 0 or more');
        }

        return $this->generator->getBytes($count);
    }
513843
protected function preparePagination(Demand $demand, int $count): array
    {
        $numberOfPages = ceil($count / $demand->getLimit());
        $endRecord = $demand->getOffset() + $demand->getLimit();
        if ($endRecord > $count) {
            $endRecord = $count;
        }

        $pagination = [
            'current' => $demand->getPage(),
            'numberOfPages' => $numberOfPages,
            'hasLessPages' => $demand->getPage() > 1,
            'hasMorePages' => $demand->getPage() < $numberOfPages,
            'startRecord' => $demand->getOffset() + 1,
            'endRecord' => $endRecord
        ];
        if ($pagination['current'] < $pagination['numberOfPages']) {
            $pagination['nextPage'] = $pagination['current'] + 1;
        }
        if ($pagination['current'] > 1) {
            $pagination['previousPage'] = $pagination['current'] - 1;
        }
        return $pagination;
    }
1358373
private function format($result, $count, $offset, $limit)
    {
        $nodes = [];
        foreach ($result as $item) {
            $resource = $this->getResource($item);
            $data = $this->getResourceData($resource);
            if ($data) {
                $nodes[] = $data;
            }
        }
        return [
            'total'  => $count,
            'offset' => $offset,
            'limit'  => $limit,
            'nodes'  => $nodes
        ];
    }
1315227
public function count($count = false): int
    {
        // 如果不传递参数,返回记录总数
        if ($count === false) {
            return $this->count;
        }

        // 记录总数
        $this->count = intval($count);

        // 计算总页数
        $this->allPage = ceil($count / $this->size);

        // 调整当前页数,不能大于总页数
        $this->page = max(1, min($this->page, $this->allPage));

        return $this->count;
    }
1108430
public function decodeBytes($count = 1)
    {
        if (!is_int($count) || $count < 0) {
            throw new \InvalidArgumentException();
        }

        if (!$count) {
            return '';
        }

        return $this->buffer->get($count);
    }
751428
private function readLinearRings($count)
    {
        $rings = array();

        for ($i = 0; $i < $count; $i++) {
            $rings[] = $this->readPoints($this->readCount());
        }

        return $rings;
    }
832347
private function createSessions($count)
    {
        $args = [
            'database' => $this->database->name(),
            'session' => [
                'labels' => isset($this->config['labels']) ? $this->config['labels'] : []
            ]
        ];

        $promises = [];

        for ($i = 0; $i < $count; $i++) {
            $promises[] = $this->database->connection()->createSessionAsync($args);
        }

        $results = Promise\settle($promises)->wait();

        $sessions = [];

        foreach ($results as $result) {
            if ($result['state'] === 'fulfilled') {
                $name = $result['value']->getName();
                $sessions[] = [
                    'name' => $name,
                    'expiration' => $this->time() + SessionPoolInterface::SESSION_EXPIRATION_SECONDS
                ];
            }
        }

        return $sessions;
    }
1114878
public function translate($message, $count = null)
	{
		return isset($this->dictionary[$message]) ? $this->dictionary[$message] : $message;
	}
790311
public function slice($index, $count = null){
		
		if(!$this->offsetExists($index)){
			throw new \OutOfRangeException('$index is invalid');
		}
		
		$arr = \array_slice($this->_Arr, $index, $count);
		return new static($arr);
		
	}