@return int

@throws \Exception
542073
public function getCurrentPageNumber()
    {
        $optionsRenderer = $this->getOptionsRenderer();
        $parameterNames = $optionsRenderer['parameterNames'];

        $request = $this->getRequest();
        if ($request instanceof HttpRequest) {
            $this->currentPageNumber = (int) $request->getPost(
                $parameterNames['currentPage'],
                $request->getQuery($parameterNames['currentPage'], 1)
            );
        }

        return (int) $this->currentPageNumber;
    }
34333
public function getOrderNumber() : ?int 
    {
        if ( ! $this->hasOrderNumber()) {
            $this->setOrderNumber($this->getDefaultOrderNumber());
        }
        return $this->orderNumber;
    }
972416
private function number()
    {
        // If next token is a float match and return it
        if ($this->lexer->isNextToken(Lexer::T_FLOAT)) {
            return $this->match(Lexer::T_FLOAT);
        }

        // If next token is an integer match and return it
        if ($this->lexer->isNextToken(Lexer::T_INTEGER)) {
            return $this->match(Lexer::T_INTEGER);
        }

        // Throw exception since no match
        throw $this->syntaxError('CrEOF\Geo\String\Lexer::T_INTEGER or CrEOF\Geo\String\Lexer::T_FLOAT');
    }
357612
public function parse(): int
    {
        // convert constants to ints
        $this->expression = $this->convertErrorConstants($this->expression);
        $this->expression = str_replace(
            [',', ' '],
            ['.', ''],
            $this->expression
        );

        return $this->compute($this->expression);
    }
652370
public function getInt($key)
    {
        try {
            $result = $this->get(self::INT, $key);
            if (!settype($result, 'integer')) {
                return 0;
            }
        } catch (\Exception $e) {
            return 0;
        }
        return $result;
    }
777878
public function count()
    {
        if($this->elements instanceof \Countable) {
            return $this->elements->count();
        }

        $count = 0;

        foreach($this->elements as $value) {
            $count++;
        }

        return $count;
    }
61482
public function balance() {
        $data = $this->getSend()->parameters([
            'method' => 'GetNum'
        ])->json();
        if ($data['code'] == 2) {
            return $data['num'];
        }
        throw new \Exception($data['msg']);
    }
993573
protected function serverPort(): int
    {
        if ($this->serverPort !== null) {
            return $this->serverPort;
        }

        $iterator = $this->process->getIterator(SymfonyProcess::ITER_SKIP_ERR | SymfonyProcess::ITER_KEEP_OUTPUT);

        foreach ($iterator as $data) {
            return $this->serverPort = (int) $data;
        }

        // If the iterator didn't execute properly, then the process must have failed, we must check to be sure.
        $this->checkProcessStatus();
    }
988903
public function getAutoIncrement(): int
    {
        $this->checkRepository();

        $table = $this->getClassMetadata()->getTableName();

        $connection = $this->getEntityManager()->getConnection();
        $statement  = $connection->prepare('SHOW TABLE STATUS LIKE "'.$table.'" ');
        $statement->execute();
        $data = $statement->fetch();

        return (int) $data['Auto_increment'];
    }
593767
public function tell() : int
    {
        $pos = null;
        $err = ($this->stream === null || $this->isPipe === true);

        if ($err === false) {
            $pos = ftell($this->stream);
            $err = ($pos === false);
        }

        if ($err === true) {
            // @codeCoverageIgnoreStart
            throw new \RuntimeException("Could not get the position of the pointer in stream.");
            // @codeCoverageIgnoreEnd
        }

        return $pos;
    }
941983
public function getPage(): int {
        if ($this->getLimit() === 0) {
            return 1;
        }
        $result = floor($this->getOffset() / (int)$this->getLimit()) + 1;
//        $result = intdiv($this->getOffset(), (int)$this->getLimit()) + 1;
        return (int)$result;
    }
1114914
protected function getHttpStatusCode(Exception $exception): int
    {
        if ($exception instanceof ApiException) {
            return $exception->apiMessage->getHttpStatusCode();
        }

        if ($exception instanceof HttpExceptionInterface && method_exists($exception, 'getStatusCode')) {
            return $exception->getStatusCode();
        }

        return 500;
    }
318774
private function readNumber()
    {
        // Open
        if (false === $this->handle = fopen($this->path, 'c+')) {
            throw new RuntimeException("Failed to open file {$this->path}.");
        }
        // Exclusive lock
        if (!flock($this->handle, LOCK_EX)) {
            throw new RuntimeException("Failed to lock file {$this->path}.");
        }

        if (false !== $number = fread($this->handle, 10)) {
            return intval($number);
        }

        return 0;
    }
771964
public function next():int
    {
        $timestamp = $this->milliTime();
        if ($timestamp < $this->_lastTimestamp) {
            throw new Exception(sprintf("Clock moved backwards.  Refusing to generate id for %d milliseconds", $this->_lastTimestamp - $timestamp));
        }
        if ($this->_lastTimestamp == $timestamp) {
            $this->_sequence = ($this->_sequence + 1) & self::SEQUENCE_MASK;
            if ($this->_sequence == 0) {
                $timestamp = $this->waitNextMilli($this->_lastTimestamp);
            }
        } else {
            $this->_sequence = 0;
        }
        $this->_lastTimestamp = $timestamp;
        return (($timestamp - $this->epoch) << self::TIMESTAMP_LEFT_SHIFT)
            | ($this->dataCenterId << self::DATA_CENTER_ID_SHIFT)
            | ($this->workerId << self::WORKER_ID_SHIFT)
            | $this->_sequence;
    }
670527
public function delete(): int
    {
        try {
            $query = (clone $this)->setDelete()->apply($this->database->getTablePrefixer());
            $compiled = $this->database->getGrammar()->compileDelete($query);
            return $this->database->delete($compiled->getSQL(), $compiled->getBindings());
        } catch (\Throwable $exception) {
            return $this->handleException($exception);
        }
    }
574173
protected function getPid(): int
    {
        $pid = 0;

        if (is_readable($this->getConfig('swoole.pid_file'))) {
            $pid = file_get_contents($this->getConfig('swoole.pid_file'));
        }

        return $pid;
    }
1020643
public function getCount()
    {
        if ($this->count === NULL) {
            $this->count = $this->getModel()->getCount();
        }

        return $this->count;
    }