asm89 / twig-lint

Standalone twig linter.
MIT License
118 stars 32 forks source link

Lint fails with "same as" test #33

Open neilime opened 7 years ago

neilime commented 7 years ago

Hi,

here is an unexpected lint error :

{% if foo.attribute is same as(false) %}
    the foo attribute really is the 'false' PHP value
{% endif %}

Error :

>> 1      {% if foo.attribute is same as(false) %}
           >> Unexpected token "name" of value "as" ("end of statement block" expected).
              2          the foo attribute really is the 'false' PHP value
              3      {% endif %}

However it works with the test "sameas".

(Twig doc : http://twig.sensiolabs.org/doc/2.x/tests/sameas.html)

Thanks for your help.

seanhamlin commented 5 years ago

Experiencing the same issue. This is basically a show stopper for me to use this linter.

>> 10             {% if count > 0 and not type is same as('total') %}
>> Unexpected token "name" of value "as" ("end of statement block" expected)
asm89 commented 3 years ago

Is this still an issue on the most recent version?

bronzehedwick commented 3 years ago

@asm89 Yes I can confirm this is still an issue on version 1.0.3.