{"id":18534195,"url":"https://github.com/spaceemotion/php-coding-standard","last_synced_at":"2026-03-08T20:32:43.264Z","repository":{"id":40429772,"uuid":"244753551","full_name":"spaceemotion/php-coding-standard","owner":"spaceemotion","description":"Combines various code quality tools into a single command with shared output for easier CI integration","archived":false,"fork":false,"pushed_at":"2024-05-31T20:52:39.000Z","size":208,"stargazers_count":18,"open_issues_count":5,"forks_count":5,"subscribers_count":2,"default_branch":"wip/v1","last_synced_at":"2025-08-06T19:59:51.502Z","etag":null,"topics":["analysis","automation","code-quality","hacktoberfest","linting","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spaceemotion.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},"funding":{"ko_fi":"spaceemotion"}},"created_at":"2020-03-03T22:19:10.000Z","updated_at":"2024-05-31T20:52:43.000Z","dependencies_parsed_at":"2024-05-31T21:56:11.511Z","dependency_job_id":"90476b7a-45ec-4079-8341-b31678ff3985","html_url":"https://github.com/spaceemotion/php-coding-standard","commit_stats":{"total_commits":242,"total_committers":7,"mean_commits":34.57142857142857,"dds":0.04132231404958675,"last_synced_commit":"2e7843c98db10d2380d0a09e73a1eb2f0a91294c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/spaceemotion/php-coding-standard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spaceemotion%2Fphp-coding-standard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spaceemotion%2Fphp-coding-standard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spaceemotion%2Fphp-coding-standard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spaceemotion%2Fphp-coding-standard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spaceemotion","download_url":"https://codeload.github.com/spaceemotion/php-coding-standard/tar.gz/refs/heads/wip/v1","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spaceemotion%2Fphp-coding-standard/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269457772,"owners_count":24420289,"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","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"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":["analysis","automation","code-quality","hacktoberfest","linting","php"],"created_at":"2024-11-06T19:14:53.174Z","updated_at":"2026-03-08T20:32:43.237Z","avatar_url":"https://github.com/spaceemotion.png","language":"PHP","funding_links":["https://ko-fi.com/spaceemotion"],"categories":[],"sub_categories":[],"readme":"[![Latest Version on Packagist](https://img.shields.io/packagist/v/spaceemotion/php-coding-standard.svg?style=flat-square)](https://packagist.org/packages/spaceemotion/php-coding-standard) \n[![Total Downloads](https://img.shields.io/packagist/dt/spaceemotion/php-coding-standard.svg?style=flat-square)](https://packagist.org/packages/spaceemotion/php-coding-standard)\n\n# php-coding-standard (phpcstd)\n\n\u003cimg src=\"./img/project-workflow.png\" alt=\"diagram of the project workflow\" width=\"350\" align=\"right\"\u003e\n\n`phpcstd` combines various code quality tools (e.g. linting and static analysis)\ninto one, easy to use package which can be shared across teams and code bases.\n\nThere are two parts to this:\n1. `phpcstd` executes all the enabled tools and returns a single per-file error output\n2. In your projects, you depend on a single repository (e.g. `acme/coding-standard`) \n   which depends on `phpcstd` and includes the various base configurations \n   (e.g. phpmd.xml, ecs.yaml, ...). Your own projects then depend on your own coding standard.\n\n`phpcstd` itself does not come with any tools preinstalled. \nYou can take a look at [my own coding standards](https://github.com/spaceemotion/my-php-coding-standard) as an example.\n\n#### Tools supported\nTool | Lint | Fix | Source list | Description\n-----|------|-----|-------------|-----------\n⭐ [EasyCodingStandard](https://github.com/symplify/easy-coding-standard) | ✅ | ✅ | ✅ | Combination of PHP_CodeSniffer and PHP-CS-Fixer\n[PHP Mess Detector](https://github.com/phpmd/phpmd) | ✅ | ❌ | ✅ | Code complexity checker\n[PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) | ✅ | ✅ | ✅ | Style linter + fixer\n⭐ [composer-normalize](https://github.com/ergebnis/composer-normalize) | ✅ | ✅ | ✅ | Validates and rearranges composer.json files\n[phan](https://github.com/phan/phan) | ✅ | ✅ | ❌ | Static analyzer, requires the \"php-ast\" extension\n⭐ [php-parallel-lint](https://github.com/php-parallel-lint/php-parallel-lint) | ✅ | ❌ | ✅ | Checks for PHP (syntax) errors (using `php -l`)\n⭐ [phpstan](https://github.com/phpstan/phpstan) | ✅ | ❌ | ⏹ | Static analyzer, source list is optional, but not recommended\n[psalm](https://github.com/vimeo/psalm) | ✅ | ✅ | ✅ | Static analyzer\n⭐ [rector](https://github.com/rectorphp/rector) | ✅ | ✅ | ✅ | Code up-/downgrading and refactoring tool\n[deptrac](https://github.com/qossmic/deptrac) | ✅ | ❌ | ❌ | Static analyzer that enforces rules for dependencies between software layers\n\n_⭐ = recommended_\n\n## Getting started\n```\ncomposer require-dev spaceemotion/php-coding-standard\n```\n\nThis will install the `phpcstd` binary to your vendor folder.\n\n### Configuration via .phpcstd(.dist).ini\nTo minimize dependencies, `phpcstd` uses .ini-files for its configuration.\nIf no `.phpcstd.ini` file can be found in your project folder,\na `.phpcstd.dist.ini` file will be used as fallback (if possible).\n\n### Command options\n```\nUsage:\n  run [options] [--] [\u003cfiles\u003e...]\n\nArguments:\n  files                 List of files to parse instead of the configured sources\n\nOptions:\n  -s, --skip=SKIP       Disables the list of tools during the run (comma-separated list) (multiple values allowed)\n  -o, --only=ONLY       Only executes the list of tools during the run (comma-separated list) (multiple values allowed)\n      --continue        Run the next check even if the previous one failed\n      --fix             Try to fix any linting errors\n      --hide-source     Hides the \"source\" lines from console output\n      --lint-staged     Uses \"git diff\" to determine staged files to lint\n      --ci              Changes the output format to GithubActions for better CI integration\n      --no-fail         Only returns with exit code 0, regardless of any errors/warnings\n  -h, --help            Display help for the given command. When no command is given display help for the run command\n  -q, --quiet           Do not output any message\n  -V, --version         Display this application version\n      --ansi            Force ANSI output\n      --no-ansi         Disable ANSI output\n  -n, --no-interaction  Do not ask any interactive question\n  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug\n```\n\nInstead of defining the files/folders directly (in either the config or as arguments), you can also pipe a list into it:\n```\n$ ls -A1 | vendor/bin/phpcstd\n```\n\n## Git Hooks\nTo not have to wait for CI pipelines to finish, you can use git hooks to run over the changed files before committing.\n\n```sh\nvendor/bin/phpcstd --lint-staged\n```\n\n## CI-Support\n### Github Actions\nThe `--ci` flag returns a format that can be used by GithubActions to annotate commits and PRs\n(see [their documentation on how this works](https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers)).\n\n![example file change with an error](./img/github-annotation.png)\n\n## Development\n### Using Docker\n1. Spin up the container using `GITHUB_PERSONAL_ACCESS_TOKEN=\u003ctoken\u003e docker-compose up -d --build`\n2. Run all commands using `docker-compose exec php \u003ccommand here\u003e`\n\n### Using XDebug\nThis project uses [composer/xdebug-handler](https://github.com/composer/xdebug-handler) to improve performance\nby disabling xdebug upon startup. To enable XDebug during development you need to set the following env variable:\n`PHPCSTD_ALLOW_XDEBUG=1` (as written in their README).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspaceemotion%2Fphp-coding-standard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspaceemotion%2Fphp-coding-standard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspaceemotion%2Fphp-coding-standard/lists"}