Skip to content

Using stringable object as query parameter fails  #203

@janedbal

Description

@janedbal
$dbalConnection->fetchAssociative('
    SELECT *
    FROM bar
    WHERE foo = :enum
', [
    'enum' => new Enum('foo'),
]);

Causes error:

Uncaught staabm\PHPStanDba\DbaException: Unexpected expression type PHPStan\Type\ObjectType in /app/vendor/staabm/phpstan-dba/src/QueryReflection/QuerySimulation.php:91

Even though the Enum has __toString method which works fine in dbal query.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions