{"id":47258452,"url":"https://github.com/VincentLanglet/Twig-CS-Fixer","last_synced_at":"2026-03-29T03:00:42.693Z","repository":{"id":43468976,"uuid":"382859231","full_name":"VincentLanglet/Twig-CS-Fixer","owner":"VincentLanglet","description":"A tool to automatically fix Twig Coding Standards issues","archived":false,"fork":false,"pushed_at":"2026-02-23T13:22:53.000Z","size":935,"stargazers_count":325,"open_issues_count":10,"forks_count":35,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-02-23T21:41:27.935Z","etag":null,"topics":["code-style","coding-standards","twig"],"latest_commit_sha":null,"homepage":"https://twigcsfixer.github.io/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VincentLanglet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["VincentLanglet"]}},"created_at":"2021-07-04T13:30:27.000Z","updated_at":"2026-02-23T13:21:42.000Z","dependencies_parsed_at":"2026-02-02T00:21:46.035Z","dependency_job_id":null,"html_url":"https://github.com/VincentLanglet/Twig-CS-Fixer","commit_stats":{"total_commits":379,"total_committers":19,"mean_commits":19.94736842105263,"dds":0.09762532981530347,"last_synced_commit":"63c500016f7eb34a0f2aa2cfe8e1ac834fd857ba"},"previous_names":[],"tags_count":72,"template":false,"template_full_name":null,"purl":"pkg:github/VincentLanglet/Twig-CS-Fixer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VincentLanglet%2FTwig-CS-Fixer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VincentLanglet%2FTwig-CS-Fixer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VincentLanglet%2FTwig-CS-Fixer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VincentLanglet%2FTwig-CS-Fixer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VincentLanglet","download_url":"https://codeload.github.com/VincentLanglet/Twig-CS-Fixer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VincentLanglet%2FTwig-CS-Fixer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31130811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-29T01:34:30.680Z","status":"online","status_checked_at":"2026-03-29T02:00:07.786Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-style","coding-standards","twig"],"created_at":"2026-03-14T22:00:47.164Z","updated_at":"2026-03-29T03:00:42.683Z","avatar_url":"https://github.com/VincentLanglet.png","language":"PHP","funding_links":["https://github.com/sponsors/VincentLanglet"],"categories":["PHP"],"sub_categories":[],"readme":"# Twig CS Fixer\n\n[![PHP Version](https://poser.pugx.org/vincentlanglet/twig-cs-fixer/require/php)](https://packagist.org/packages/vincentlanglet/twig-cs-fixer)\n[![Latest Stable Version](https://poser.pugx.org/vincentlanglet/twig-cs-fixer/v)](https://github.com/VincentLanglet/Twig-CS-Fixer/releases/latest)\n[![License](https://poser.pugx.org/vincentlanglet/twig-cs-fixer/license)](https://github.com/VincentLanglet/Twig-CS-Fixer/blob/main/LICENCE)\n[![Actions Status](https://github.com/VincentLanglet/Twig-CS-Fixer/workflows/Test/badge.svg)](https://github.com/VincentLanglet/Twig-CS-Fixer/actions/workflows/test.yaml?query=branch%3Amain)\n[![Coverage](https://codecov.io/gh/VincentLanglet/Twig-CS-Fixer/branch/main/graph/badge.svg)](https://codecov.io/gh/VincentLanglet/Twig-CS-Fixer/branch/main)\n[![Infection MSI](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FVincentLanglet%2FTwig-CS-Fixer%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/VincentLanglet/Twig-CS-Fixer/main)\n\n## Installation\n\n### From composer\n\nThis tool can be installed with [Composer](https://getcomposer.org/).\n\nAdd the package as a dependency of your project\n\n```bash\ncomposer require --dev vincentlanglet/twig-cs-fixer\n```\n\nThen, use it!\n\n```bash\nvendor/bin/twig-cs-fixer lint /path/to/code\nvendor/bin/twig-cs-fixer fix /path/to/code\n```\n\n\u003e [!NOTE]\n\u003e Although [bin-dependencies may have composer conflicts](https://github.com/bamarni/composer-bin-plugin#why-a-hard-problem-with-a-simple-solution),\n\u003e this is the recommended way because it will autoload everything you need.\n\n### As a PHAR\n\nYou can always fetch the stable version as a Phar archive through the following\nlink with the `VERSION` you're looking for:\n\n```bash\nwget -c https://github.com/VincentLanglet/Twig-CS-Fixer/releases/download/VERSION/twig-cs-fixer.phar\n```\n\nThe PHAR files are signed with a public key which can be queried at \n`keys.openpgp.org` with the id `AC0E7FD8858D80003AA88FF8DEBB71EDE9601234`.\n\n\u003e [!TIP]\n\u003e You will certainly need to add\n\u003e ```php\n\u003e require_once __DIR__.'/vendor/autoload.php';\n\u003e ```\n\u003e in your [config file](docs/configuration.md) in order to:\n\u003e - Use existing [node based rules](docs/configuration.md#node-based-rules).\n\u003e - Write your own custom rules.\n\n## Twig Coding Standard Rules\n\nFrom the [official one](https://twig.symfony.com/doc/3.x/coding_standards.html).\n\n### Delimiter spacing\n\nEnsures there is a single space after a delimiter opening (`{{`, `{%` and `{#`)\nand before a delimiter closing (`}}`, `%}` and `#}`).\n\nWhen using a whitespace control character, do not put any spaces between it and the delimiter.\n\n### Operator spacing\n\nEnsures there is a single space before and after the following operators:\ncomparison operators (`==`, `!=`, `\u003c`, `\u003e`, `\u003e=`, `\u003c=`), math operators (`+`, `-`, `/`, `*`, `%`, `//`, `**`),\nlogic operators (`not`, `and`, `or`), `~`, `is`, `in`, and the ternary operator (`?:`).\n\nRemoves any space before and after the `..` operator.\n\n### Punctuation spacing\n\nEnsures there is a single space after `:` in hashes and `,` in arrays and hashes.\n\nRemoves any space after an opening parenthesis and before a closing parenthesis in expressions.\n\nRemoves any space before and after the following operators: `|`, `.`, `[]`.\n\nRemoves any space before and after parenthesis in filter and function calls.\n\nRemoves any space before and after opening and closing of arrays and hashes.\n\n### Macro \u0026 Function/Filter/Test\n\nEnsures there is a single space before and after `=` in macro argument declarations.\n\nEnsures there is no space before and after `=` sign when using named arguments.\n\nEnsures one space after the `:` sign when using named arguments.\n\nUse `:` instead of `=` to separate argument names and values.\n\n### Naming\n\nUse snake case for all variable names.\n\nUse snake case for all argument names.\n\nUse snake case for all named arguments.\n\n## Custom configuration\n\nBy default, the twig-cs-fixer standard is enabled with the twig coding standard rules and some extra rules.\nThis tool also provides a standard with only the twig rules\nand another standard with extra rules from the symfony coding standards.\n\nEverything is configurable, so take a look at the following documentation:\n- [Configuration](docs/configuration.md)\n- [Ignoring errors](docs/ignoring-errors.md)\n- [Rules \u0026 Standard](docs/rules.md)\n- [How to write a custom rule](docs/custom.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVincentLanglet%2FTwig-CS-Fixer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FVincentLanglet%2FTwig-CS-Fixer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVincentLanglet%2FTwig-CS-Fixer/lists"}