{"id":16446084,"url":"https://github.com/gomzyakov/php-cs-fixer-config","last_synced_at":"2025-06-14T19:06:25.720Z","repository":{"id":38312682,"uuid":"500169580","full_name":"gomzyakov/php-cs-fixer-config","owner":"gomzyakov","description":"Use the same php-cs-fixer configuration across all of your projects","archived":false,"fork":false,"pushed_at":"2024-04-22T10:30:27.000Z","size":146,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-22T11:32:46.726Z","etag":null,"topics":["code-standards","code-style","code-styles","code-styling","laravel","laravel-pint","php","php-cs-fixer","php-cs-fixer-config","php-cs-fixer-ruleset","php-styles","pint"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/gomzyakov/php-cs-fixer-config","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/gomzyakov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-06-05T17:46:20.000Z","updated_at":"2024-08-19T09:20:26.798Z","dependencies_parsed_at":"2023-10-03T13:40:09.170Z","dependency_job_id":"670a2614-2493-4c10-adfd-87a2ba4e402c","html_url":"https://github.com/gomzyakov/php-cs-fixer-config","commit_stats":{"total_commits":65,"total_committers":4,"mean_commits":16.25,"dds":"0.36923076923076925","last_synced_commit":"3eba900523729209160655200f51d74f15eb456f"},"previous_names":[],"tags_count":82,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomzyakov%2Fphp-cs-fixer-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomzyakov%2Fphp-cs-fixer-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomzyakov%2Fphp-cs-fixer-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomzyakov%2Fphp-cs-fixer-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gomzyakov","download_url":"https://codeload.github.com/gomzyakov/php-cs-fixer-config/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244745632,"owners_count":20503042,"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":["code-standards","code-style","code-styles","code-styling","laravel","laravel-pint","php","php-cs-fixer","php-cs-fixer-config","php-cs-fixer-ruleset","php-styles","pint"],"created_at":"2024-10-11T09:46:22.477Z","updated_at":"2025-03-21T05:30:35.424Z","avatar_url":"https://github.com/gomzyakov.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Code-style configuration for `php-cs-fixer`\n\n[![packagist](https://img.shields.io/packagist/v/gomzyakov/php-cs-fixer-config.svg)](https://packagist.org/packages/gomzyakov/php-cs-fixer-config)\n[![downloads_count](https://img.shields.io/packagist/dt/gomzyakov/php-cs-fixer-config.svg)](https://packagist.org/packages/gomzyakov/php-cs-fixer-config)\n[![license](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/gomzyakov/php-cs-fixer-config/blob/development/LICENSE)\n[![codecov](https://codecov.io/gh/gomzyakov/php-cs-fixer-config/branch/main/graph/badge.svg?token=4CYTVMVUYV)](https://codecov.io/gh/gomzyakov/php-cs-fixer-config)\n\nThis package allows sharing identical [php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) formatting rules across all of your projects without copy-and-pasting configuration files.\n\n## Quickstart\n\n### Step 1 of 3\n\nInstall [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer) \u0026 this package via Composer:\n\n```sh\ncomposer require --dev friendsofphp/php-cs-fixer gomzyakov/php-cs-fixer-config\n```\n\n### Step 2 of 3\n\nThen create file `.php-cs-fixer.dist.php` at the root of your project with following contents:\n\n```php\n\u003c?php\n\nuse Gomzyakov\\CS\\Finder;\nuse Gomzyakov\\CS\\Config;\n\n// Routes for analysis with `php-cs-fixer`\n$routes = ['./src', './tests'];\n\nreturn Config::createWithFinder(Finder::createWithRoutes($routes));\n```\n\nChange the value of `$routes` depending on where your project's source code is.\n\n### Step 3 of 3\n\n**And that's it!** You can now find code style violations with following command:\n\n```sh\n./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run\n```\n\nAnd then completely fix them all with:\n\n```sh\n./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php\n```\n\n## Configuration\n\nYou must pass a set of routes to the `Finder::createWithRoutes()` call. For example, for [Laravel](https://laravel.com) projects, this would be:\n\n```php\nFinder::createWithRoutes(['./app', './config', './database', './routes', './tests'])\n```\n\nAlso, you can pass a custom set of rules to the `Config::createWithFinder()` call:\n\n```php\nConfig::createWithFinder($finder, [\n    '@PHP81Migration'   =\u003e true,\n    'array_indentation' =\u003e false\n])\n```\n\n## Support\n\nIf you find any package errors, please, [make an issue](https://github.com/gomzyakov/php-cs-fixer-config/issues) in current repository.\n\n## License\n\nThis is open-sourced software licensed under the [MIT License](https://github.com/gomzyakov/php-cs-fixer-config/blob/main/LICENSE).\n\n## Special thanks\n\n- https://github.com/FriendsOfPHP/PHP-CS-Fixer\n- https://mlocati.github.io/php-cs-fixer-configurator/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgomzyakov%2Fphp-cs-fixer-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgomzyakov%2Fphp-cs-fixer-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgomzyakov%2Fphp-cs-fixer-config/lists"}