doctrine/orm · error · LogicException

Option 'max-result' must contain an integer value

Error message

Option 'max-result' must contain an integer value

What it means

Error "Option 'max-result' must contain an integer value" thrown in doctrine/orm.

Source

Thrown at src/Tools/Console/Command/RunDqlCommand.php:100

                $hydrationModeName,
            ));
        }

        $query = $em->createQuery($dql);

        $firstResult = $input->getOption('first-result');
        if ($firstResult !== null) {
            if (! is_numeric($firstResult)) {
                throw new LogicException("Option 'first-result' must contain an integer value");
            }

            $query->setFirstResult((int) $firstResult);
        }

        $maxResult = $input->getOption('max-result');
        if ($maxResult !== null) {
            if (! is_numeric($maxResult)) {
                throw new LogicException("Option 'max-result' must contain an integer value");
            }

            $query->setMaxResults((int) $maxResult);
        }

        if ($input->getOption('show-sql')) {
            $ui->text($query->getSQL());

            return 0;
        }

        $resultSet = $query->execute([], constant($hydrationMode));

        $ui->text(Debug::dump($resultSet, (int) $input->getOption('depth')));

        return 0;
    }
}

View on GitHub (pinned to d9b9ff7301)

When it happens

Trigger: Thrown at src/Tools/Console/Command/RunDqlCommand.php:100 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of doctrine/orm@d9b9ff7301 (2026-08-21). Data as JSON: /api/errors/f230258d9f33b53b. Report an issue: GitHub.