{"id":16568703,"url":"https://github.com/drupol/phpcsfixer-configs-drupal","last_synced_at":"2025-03-21T11:33:38.921Z","repository":{"id":56972703,"uuid":"197816141","full_name":"drupol/phpcsfixer-configs-drupal","owner":"drupol","description":"Base PHP CS Fixer configurations for Drupal 7 and 8.","archived":false,"fork":false,"pushed_at":"2024-02-15T12:45:07.000Z","size":115,"stargazers_count":7,"open_issues_count":2,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-01T19:24:15.300Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/drupol.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"drupol"}},"created_at":"2019-07-19T17:27:21.000Z","updated_at":"2024-06-19T01:27:27.453Z","dependencies_parsed_at":"2024-06-19T01:27:21.219Z","dependency_job_id":null,"html_url":"https://github.com/drupol/phpcsfixer-configs-drupal","commit_stats":{"total_commits":12,"total_committers":2,"mean_commits":6.0,"dds":0.08333333333333337,"last_synced_commit":"774b1b9e160e1d4223758d406d89046c575bf6c5"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupol%2Fphpcsfixer-configs-drupal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupol%2Fphpcsfixer-configs-drupal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupol%2Fphpcsfixer-configs-drupal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupol%2Fphpcsfixer-configs-drupal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drupol","download_url":"https://codeload.github.com/drupol/phpcsfixer-configs-drupal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221815058,"owners_count":16885107,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-11T21:11:26.792Z","updated_at":"2024-10-28T10:06:17.385Z","avatar_url":"https://github.com/drupol.png","language":"PHP","funding_links":["https://github.com/sponsors/drupol","https://paypal.me/drupol"],"categories":[],"sub_categories":[],"readme":"[![Latest Stable Version](https://img.shields.io/packagist/v/drupol/phpcsfixer-configs-drupal.svg?style=flat-square)](https://packagist.org/packages/drupol/phpcsfixer-configs-drupal)\n [![GitHub stars](https://img.shields.io/github/stars/drupol/phpcsfixer-configs-drupal.svg?style=flat-square)](https://packagist.org/packages/drupol/phpcsfixer-configs-drupal)\n [![Total Downloads](https://img.shields.io/packagist/dt/drupol/phpcsfixer-configs-drupal.svg?style=flat-square)](https://packagist.org/packages/drupol/phpcsfixer-configs-drupal)\n [![License](https://img.shields.io/packagist/l/drupol/phpcsfixer-configs-drupal.svg?style=flat-square)](https://packagist.org/packages/drupol/phpcsfixer-configs-drupal)\n [![Say Thanks!](https://img.shields.io/badge/Say-thanks-brightgreen.svg?style=flat-square)](https://saythanks.io/to/drupol)\n [![Donate!](https://img.shields.io/badge/Donate-Paypal-brightgreen.svg?style=flat-square)](https://paypal.me/drupol)\n\n# PHP CS Fixer Drupal Configurations\n\n## Description\n\nThis package provides a set [PHP-Cs-Fixer](https://github.com/FriendsOfPHP/PHP CS Fixer) configuration objects ready to be used in a Drupal project.\n\n## Documentation\n\nAvailable configuration objects:\n\n* `drupol\\PhpCsFixerConfigsDrupal\\Config\\Drupal7`\n* `drupol\\PhpCsFixerConfigsDrupal\\Config\\Drupal8`\n\n## Requirements\n\n* PHP \u003e= 8.0\n* friendsofphp/php-cs-fixer \u003e= 3.35\n\n## Installation\n\nThe recommended way to install PHP CS Fixer Drupal is to use Composer in a dedicated `composer.json` file in your project, for example in the `tools/php-cs-fixer` directory:\n\n```bash\nmkdir -p tools/php-cs-fixer\ncomposer require --dev --working-dir=tools/php-cs-fixer drupol/phpcsfixer-configs-drupal\n```\n\nOr using the main `composer.json`:\n\n```bash\ncomposer require --dev drupol/phpcsfixer-configs-drupal\n```\n\n## Configuration\n\nAssuming you installed PHP CS Fixer as instructed above, you should now setup a configuration `.php-cs-fixer.php` file in the root directory of your project.\n\n```bash\ntouch .php-cs-fixer.php\n```\n\nThe example below setup PHP CS Fixer to use Drupal 8/9/10 rules:\n\n```php\n\u003c?php\n\nuse drupol\\PhpCsFixerConfigsDrupal\\Config\\Drupal8;\n\n$finder = PhpCsFixer\\Finder::create()\n  -\u003ein(['web/modules/custom'])\n  -\u003ename('*.module')\n  -\u003ename('*.inc')\n  -\u003ename('*.install')\n  -\u003ename('*.test')\n  -\u003ename('*.profile')\n  -\u003ename('*.theme')\n  -\u003enotPath('*.md')\n  -\u003enotPath('*.info.yml')\n;\n\n$config = new Drupal8();\n$config-\u003esetFinder($finder);\n\n$rules = $config-\u003egetRules();\n\n$config-\u003esetRules($rules);\nreturn $config;\n```\n\nSee the [PHP CS Fixer documentation](https://github.com/FriendsOfPHP/PHP-CS-Fixer) on how to use the advanced configuration object.\n\n## Usage\n\nAssuming you installed PHP CS Fixer as instructed above, you can run the following command to fix your Drupal project:\n\n```bash\ntools/php-cs-fixer/vendor/bin/php-cs-fixer fix\n```\n\n## Code quality, tests and benchmarks\n\nEvery time changes are introduced into the library, [Github Actions](https://github.com/drupol/phpcsfixer-configs-drupal/actions) run the tests and the benchmarks.\n\nThe library has tests written with [PHPUnit](https://phpunit.de/).\nFeel free to check them out in the `tests` directory. Run `./vendor/bin/phpunit` to trigger the tests.\n\nBefore each commit some inspections are executed with [GrumPHP](https://github.com/phpro/grumphp), run `./vendor/bin/grumphp run` to check manually.\n\n## Contributing\n\nFeel free to contribute to this library by sending Github pull requests. I'm quite reactive :-)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrupol%2Fphpcsfixer-configs-drupal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrupol%2Fphpcsfixer-configs-drupal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrupol%2Fphpcsfixer-configs-drupal/lists"}