Skip to content

Since 0.12.4 error on \Twig\Node\Expression\ConstantExpression #2819

@mitelg

Description

@mitelg

Bug report

Since the update to 0.12.04 I got this issue with the ConstantExpression of the twig template system

Parameter #1 $value of class Twig\Node\Expression\ConstantExpression constructor expects array, string given.

Code snippet that reproduces the problem

copy+paste from the Twig sources

https://phpstan.org/r/df21662f-cba0-492e-9628-3c2d3b3be617

Expected output

the $value constructor parameter has now typehint, which is probably the cause of this error. I think the most common use is a string value, but searching for new ConstantExpression shows that is is also used with booleans, null and integers. I don't know why PHPStan wants to see an array here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions