Skip to content

enque/dbal v0.10.25 incorrectly claims php 7.4 support #1393

@faldor20

Description

@faldor20

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions