k10r / twig-cs-fixer
Composer package to fix twig codestyle
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 401
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 5
Forks: 0
Open Issues: 1
Type:project
Requires
- php: ^7.3
- symfony/config: ^4 | ^5
- symfony/console: ^4 | ^5
- symfony/dependency-injection: ^4 | ^5
- symfony/finder: ^4 | ^5
Requires (Dev)
- k10r/codestyle: ^1.0
- phpstan/phpstan: ^0.12.82
- symfony/var-dumper: ^5.2
This package is auto-updated.
Last update: 2024-03-06 12:05:12 UTC
README
Implemented Rules
Function | Implemented |
---|---|
Indentation | X |
PipePrefixSpacing | X |
PipeSuffixSpacing | X |
SpaceLine | X |
TrailingSpace | X |
UppercaseVariables | X |
@var style | |
Your idea |
Setup
- Go to your project folder and execute
composer require k10r/twig-cs-fixer --dev
- Create a file named
.twig_cs
.twig_cs.dist
or.twig_cs.dist.php
- Fill this file with the small example content or the enhanced example content
- (Optional) Adjust the executed fixers according to your needs
- Execute the fixer via
vendor/bin/twig-cs-fixer
Known issues
- JavaScript (eg. everything inside
<script>
-blocks) is not touched - Multiple calls for the same function example:
{% set
- some with and some without closing block - Attribute tags are not sorted
- Multi-Line-Attributes with additional opening tag (eg.
(
,[
) are not formatted correctly