doctrine/orm · error · RuntimeException

Error while evaluating regex '/%s/'.

Error message

Error while evaluating regex '/%s/'.

What it means

Error "Error while evaluating regex '/%s/'." thrown in doctrine/orm.

Source

Thrown at src/Tools/Console/MetadataFilter.php:65

        $this->filter = (array) $filter;

        parent::__construct($metadata);
    }

    public function accept(): bool
    {
        if (count($this->filter) === 0) {
            return true;
        }

        $it       = $this->getInnerIterator();
        $metadata = $it->current();

        foreach ($this->filter as $filter) {
            $pregResult = preg_match('/' . $filter . '/', $metadata->getName());

            if ($pregResult === false) {
                throw new RuntimeException(
                    sprintf("Error while evaluating regex '/%s/'.", $filter),
                );
            }

            if ($pregResult) {
                return true;
            }
        }

        return false;
    }

    /** @return ArrayIterator<int, ClassMetadata> */
    public function getInnerIterator(): ArrayIterator
    {
        $innerIterator = parent::getInnerIterator();

        assert($innerIterator instanceof ArrayIterator);

View on GitHub (pinned to d9b9ff7301)

When it happens

Trigger: Thrown at src/Tools/Console/MetadataFilter.php:65 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/e0a18118d87aa1ea. Report an issue: GitHub.