{"id":28861373,"url":"https://github.com/fattureincloud/php-coding-standard","last_synced_at":"2025-10-25T13:01:57.172Z","repository":{"id":56981822,"uuid":"269032292","full_name":"fattureincloud/php-coding-standard","owner":"fattureincloud","description":"PHP CS Fixer coding standard, extended from @PhpCsFixer.","archived":false,"fork":false,"pushed_at":"2025-02-21T10:56:48.000Z","size":20,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-01T04:20:08.840Z","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/fattureincloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-06-03T08:27:39.000Z","updated_at":"2025-02-21T10:55:58.000Z","dependencies_parsed_at":"2025-02-21T11:39:18.363Z","dependency_job_id":null,"html_url":"https://github.com/fattureincloud/php-coding-standard","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/fattureincloud/php-coding-standard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fattureincloud%2Fphp-coding-standard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fattureincloud%2Fphp-coding-standard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fattureincloud%2Fphp-coding-standard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fattureincloud%2Fphp-coding-standard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fattureincloud","download_url":"https://codeload.github.com/fattureincloud/php-coding-standard/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fattureincloud%2Fphp-coding-standard/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260890581,"owners_count":23077863,"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":"2025-06-20T05:38:57.367Z","updated_at":"2025-10-25T13:01:57.167Z","avatar_url":"https://github.com/fattureincloud.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-coding-standard\nPHP CS Fixer coding standard, extended from @PhpCsFixer.\n\n## Prerequisites\nYou need to install PHP CS Fixer installed locally in the project and husky + lint-staged configured in order to make all of this working properly.\n\n#### Install PHP CS Fixer\n```\ncomposer require friendsofphp/php-cs-fixer --dev\n```\n\n#### Install husky + lint-staged\nCreate a `package.json` like this one:\n```\n{\n  \"description\": \"For automation purposes\",\n  \"license\": \"MIT\",\n  \"devDependencies\": {\n    \"husky\": \"^4.2.5\",\n    \"lint-staged\": \"^10.2.7\"\n  },\n  \"lint-staged\": {},\n  \"husky\": {\n    \"hooks\": {\n      \"pre-commit\": \"lint-staged\"\n    }\n  }\n}\n```\nRun `npm install`.\n\nAdd these lines to `composer.json`:\n```\n\"scripts\": {\n    ...\n    \"post-install-cmd\": \"npm_config_loglevel=silent npm install\",\n    \"post-update-cmd\": \"npm_config_loglevel=silent npm install\",\n    ...\n}\n```\nFinally, remember to add `node_modules/` to `.gitignore`.\n\n## Installation and usage\n\n```\ncomposer require fattureincloud/php-code-standard --dev\n```\n\n#### Add lint-staged action\nPut this line as lint-staged action in `package.json` in order to execute PHP CS Fixer on all the staged files at commit time.\n```\n\"lint-staged\": {\n    ...\n    \"*.php\": \"php ./vendor/bin/php-cs-fixer fix --allow-risky=yes --config ./vendor/fattureincloud/php-code-standard/.php-cs-fixer.php\"\n    ...\n},\n```\n\n#### Add composer script (optional)\nAdd the following line under `composer.json` scripts property.\n```\n\"scripts\": {\n    ...\n    \"php-cs-fixer\": \"./vendor/bin/php-cs-fixer --allow-risky=yes --config=./vendor/fattureincloud/php-code-standard/.php-cs-fixer.php\"\n    ...\n}\n```\n\n### PHPStorm\n\n#### Enable inspections\n- Search for \"PHP CS Fixer\" under Quality Tools\n- Add a local configuration with path `$PROJECT_DIR$/vendor/friendsofphp/php-cs-fixer/php-cs-fixer`\n- Search for \"PHP CS Fixer validation\" under Inspections\n- Flag \"Allow ricky rules\"\n- Select Custom ruleset\n- Click on the 3 dots and enter `\u003cyour-project-directory\u003e/vendor/fattureincloud/php-code-standard/.php-cs-fixer.php`\n\n#### Configure file watcher\nCreate a file watcher with the following values:\n```\nName: php-cs-fixer\nFile type: PHP\nScope: Current File\nProgram: $ProjectFileDir$/vendor/friendsofphp/php-cs-fixer/php-cs-fixer\nArguments: fix --allow-risky=yes --config=$ProjectFileDir$/vendor/fattureincloud/php-code-standard/.php-cs-fixer.php $FileDir$/$FileName$\nOutput paths to refresh: $FileDir$/$FileName$\n```\nDe-flag all the advanced options.\n\n#### Configure external tool (optional)\nCreate an external tool with the following values:\n```\nName: Run PHP CS Fixer\nDescription: Run PHP CS Fixer\nGroup: External Tools\nProgram: $ProjectFileDir$/vendor/friendsofphp/php-cs-fixer/php-cs-fixer\nArguments: fix --allow-risky=yes --config=$ProjectFileDir$/vendor/fattureincloud/php-code-standard/.php-cs-fixer.php --verbose $FilePath$\nWorking directory: $ProjectFileDir$\n```\nFlag `Synchronize files after execution` and `Open console for tool output`.\n\n### VSCode\nTODO\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffattureincloud%2Fphp-coding-standard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffattureincloud%2Fphp-coding-standard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffattureincloud%2Fphp-coding-standard/lists"}