enqueue-dev icon indicating copy to clipboard operation
enqueue-dev copied to clipboard

enque/dbal v0.10.25 incorrectly claims php 7.4 support

Open faldor20 opened this issue 6 months ago • 0 comments

When using enque/dbal v0.10.25 with php 7.4 the follwing error is thrown: Cannot use ::class with dynamic class name The following code snippet of DbalContext.php shows the use of $connection::class.

    public function getDbalConnection(): Connection
    {
        if (false == $this->connection) {
            $connection = call_user_func($this->connectionFactory);
            if (false == $connection instanceof Connection) {
                throw new \LogicException(sprintf('The factory must return instance of Doctrine\DBAL\Connection. It returns %s', is_object($connection) ? $connection::class : gettype($connection)));
            }

            $this->connection = $connection;
        }

        return $this->connection;
    }

Using ::class on a variable is a php 8.0 feature, not available in php 7.4

faldor20 avatar Jul 09 '25 04:07 faldor20