twigcs
twigcs copied to clipboard
The missing checkstyle for twig!
#### Steps required to reproduce the problem 1. Use a parent template with a variable `A` 2. The child template extending the parent one reset the `A` to another value....
Hello, I've the following code : ```twig {% set head_of_service_and_can_credit = is_granted(constant('App\\Application\\Entity\\User::ROLE_CHEF_SERVICE')) and not is_granted(constant('App\\Application\\Entity\\User::ROLE_RH')) and headOfServiceTypesAuthorizationCount > 0 and user.service.headOfService.validator.id == app.user.id %} ``` And the following errors :...
#### Steps required to reproduce the problem 1. Set a ruleset on severity ignore 2. Check the output #### Expected Result - Have a result ignored. #### Actual Result -...
Hey folks! Looking at the [Twig Coding Standards](https://twig.symfony.com/doc/3.x/coding_standards.html), there doesn't seem to be a set standard for defining default values in macros. However, [the official documentation for macros](https://twig.symfony.com/doc/3.x/tags/macro.html) uses spaces...
In the current Twig documentation there is a note about variable scope defined inside `for` loops: > Note that loops are scoped in Twig; therefore a variable declared inside a...
Hello, thank you for your lib, it's very useful. :partying_face: I'm in need to version a file that has invalid code when checked against the validator. I want to verify...
Hi guys! I want to get a twigc version, but command shows something like template string composer.json ```json { "require": { "friendsoftwig/twigcs": "^5.1" } } ``` ```bash php vendor/bin/twigcs --version...
Issue https://github.com/friendsoftwig/twigcs/issues/27 says: > The body of a macro is a fully isolated scope. So an import done inside a macro must be checked for usage only inside the macro....
The ForbiddenFunctions rule added in #67 doesn't detect function calls with spaces before the first parenthesis. Example: ```twig {% dump (foo) %} {{ dump (foo) }} ``` won't be detected...
The following snippet should result in an error due to a missing comma after 'line_two' but it doesn't: ``` {% set classes = [ 'line_one', 'line_two' 'line_three', ] %} {{...