{"id":23872881,"url":"https://github.com/paysera/lib-php-cs-fixer-config","last_synced_at":"2025-04-07T07:18:00.953Z","repository":{"id":23724878,"uuid":"99696202","full_name":"paysera/lib-php-cs-fixer-config","owner":"paysera","description":"PHP CS Fixer configuration for Paysera conventions","archived":false,"fork":false,"pushed_at":"2025-02-24T13:14:12.000Z","size":1885,"stargazers_count":9,"open_issues_count":7,"forks_count":19,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-31T06:06:19.091Z","etag":null,"topics":["php-cs-fixer","php-cs-fixer-config","php-cs-fixer-ruleset"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paysera.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-08T13:30:30.000Z","updated_at":"2025-02-24T13:11:38.000Z","dependencies_parsed_at":"2024-01-19T10:06:39.943Z","dependency_job_id":"22d8664d-3510-403f-9353-dc720ea2f5c5","html_url":"https://github.com/paysera/lib-php-cs-fixer-config","commit_stats":{"total_commits":89,"total_committers":13,"mean_commits":6.846153846153846,"dds":0.4606741573033708,"last_synced_commit":"8fbd192e7a07138f64f6855f297173a550a5fe6e"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paysera%2Flib-php-cs-fixer-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paysera%2Flib-php-cs-fixer-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paysera%2Flib-php-cs-fixer-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paysera%2Flib-php-cs-fixer-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paysera","download_url":"https://codeload.github.com/paysera/lib-php-cs-fixer-config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608160,"owners_count":20965953,"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":["php-cs-fixer","php-cs-fixer-config","php-cs-fixer-ruleset"],"created_at":"2025-01-03T16:35:49.952Z","updated_at":"2025-04-07T07:18:00.931Z","avatar_url":"https://github.com/paysera.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lib-php-cs-fixer-config ![](https://travis-ci.org/paysera/lib-php-cs-fixer-config.svg?branch=master)\nLibrary helps to fix PHP code to conform [Paysera PHP style guide](https://github.com/paysera/php-style-guide).\n\n## Installation\n\n### Prerequisite\n\n* Add `Paysera\\\\PhpCsFixerConfig\\\\Composer\\\\PhpCsFixerConfigProvider::copyPhpCs` script to `post-install-cmd` and `post-update-cmd`\n or other `scripts` - just make sure this script is executed on `composer install`.\n\n### Install and check\n* `composer require --dev paysera/lib-php-cs-fixer-config`.\n* Make sure `php-cs-fixer.php` file is in project directory.\n\nNo need to install php-cs-fixer itself as this library comes with binary version of the fixer.\nThis avoids requiring its dependencies inside your project, which could clash with existing ones.\n\nTo avoid duplication with php-cs-fixer library, it's named `paysera-php-cs-fixer`.\n\n##### php-cs-fixer.php files\n* `php-cs-fixer.php` - all Paysera recommended fixers.\n* `php-cs-fixer-risky.php` - all risky fixers except recommendations (comment warnings).\n* `php-cs-fixer-safe.php` - all non risky fixers.\n\n### Migration mode\n\nFor new projects you can just use all the rules as usual.\n\nFor existing projects we recommend turning on the migration mode:\n1. Add call to `enableMigrationMode([])` to `PayseraConventionsConfig` instance in your `php-cs-fixer.php` file.\n2. Run `{your-bin-dir}/php-cs-fixer` - it will give error with initial rule configuration to pass into that method.\nJust copy-and-paste it to your `php-cs-fixer.php` file.\n3. Enable one of the rules, apply fixes in the project, review and test them.\n4. Repeat with each new rule.\n\nThis allows to control which rules are enabled in the project thus letting manually tune the fixes already applied\nin the repository and forced for the new code. Also, your commits will be more focused as each of them will include only\nchanges from a single fixer.\n\nAll rules are to be configured to allow easily spotting new rules in case they would be added (or removed) into the core.\n\n### Running fixer with tests\n\nFor comments or suggestions for developers you should use default `php-cs-fixer.php` file with all the rules.\n\nFor automatic checks there might be some false-positives so `php-cs-fixer-risky.php` should be used in such cases.\n\nYou can look at `.travis.yml` file in this repository for integration with travis on each pull request of your repository\n(this will run the checks only for changed files).\n\n## Usage\n\nRun in project directory by command: `{your-bin-dir}/php-cs-fixer fix /path/to/code --verbose --dry-run --diff`\n\nUse `--config=php-cs-fixer.php` flag for custom configuration.\n\nIf `/path/to/code` is not defined `php-cs-fixer` will run files from default `src` directory excluding `Test` folders.\n\n`--verbose` - show the applied rules. When using the txt format it will also display progress notifications.\n\nA combination of `--dry-run` and `--diff` will display a summary of proposed fixes, leaving your files unchanged.\n\n`--format` option for the output format. Supported formats are `txt` (default one), `json`, `xml` and `junit`.\n\nMore information: [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaysera%2Flib-php-cs-fixer-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaysera%2Flib-php-cs-fixer-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaysera%2Flib-php-cs-fixer-config/lists"}