PHPackages                             spaceemotion/php-coding-standard - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. spaceemotion/php-coding-standard

ActiveLibrary[Testing &amp; Quality](/categories/testing)

spaceemotion/php-coding-standard
================================

Combines multiple code quality tools into one binary with unified output.

19145.3k↓28.2%7[5 issues](https://github.com/spaceemotion/php-coding-standard/issues)[2 PRs](https://github.com/spaceemotion/php-coding-standard/pulls)6PHPCI failing

Since Dec 15Pushed 2y ago2 watchersCompare

[ Source](https://github.com/spaceemotion/php-coding-standard)[ Packagist](https://packagist.org/packages/spaceemotion/php-coding-standard)[ RSS](/packages/spaceemotion-php-coding-standard/feed)WikiDiscussions wip/v1 Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (6)

[![Latest Version on Packagist](https://camo.githubusercontent.com/07e591577facddd0f5065c04fc372460787fc9ce99db6a5e26a68454fa4549a0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370616365656d6f74696f6e2f7068702d636f64696e672d7374616e646172642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spaceemotion/php-coding-standard)[![Total Downloads](https://camo.githubusercontent.com/834043c34339af49fdd542fd0ae0268c09f108b30b29c88e8607f525ac327618/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370616365656d6f74696f6e2f7068702d636f64696e672d7374616e646172642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spaceemotion/php-coding-standard)

php-coding-standard (phpcstd)
=============================

[](#php-coding-standard-phpcstd)

[![diagram of the project workflow](./img/project-workflow.png)](./img/project-workflow.png)

`phpcstd` combines various code quality tools (e.g. linting and static analysis) into one, easy to use package which can be shared across teams and code bases.

There are two parts to this:

1. `phpcstd` executes all the enabled tools and returns a single per-file error output
2. In your projects, you depend on a single repository (e.g. `acme/coding-standard`) which depends on `phpcstd` and includes the various base configurations (e.g. phpmd.xml, ecs.yaml, ...). Your own projects then depend on your own coding standard.

`phpcstd` itself does not come with any tools preinstalled. You can take a look at [my own coding standards](https://github.com/spaceemotion/my-php-coding-standard) as an example.

#### Tools supported

[](#tools-supported)

ToolLintFixSource listDescription⭐ [EasyCodingStandard](https://github.com/symplify/easy-coding-standard)✅✅✅Combination of PHP\_CodeSniffer and PHP-CS-Fixer[PHP Mess Detector](https://github.com/phpmd/phpmd)✅❌✅Code complexity checker[PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)✅✅✅Style linter + fixer⭐ [composer-normalize](https://github.com/ergebnis/composer-normalize)✅✅✅Validates and rearranges composer.json files[phan](https://github.com/phan/phan)✅✅❌Static analyzer, requires the "php-ast" extension⭐ [php-parallel-lint](https://github.com/php-parallel-lint/php-parallel-lint)✅❌✅Checks for PHP (syntax) errors (using `php -l`)⭐ [phpstan](https://github.com/phpstan/phpstan)✅❌⏹Static analyzer, source list is optional, but not recommended[psalm](https://github.com/vimeo/psalm)✅✅✅Static analyzer⭐ [rector](https://github.com/rectorphp/rector)✅✅✅Code up-/downgrading and refactoring tool[deptrac](https://github.com/qossmic/deptrac)✅❌❌Static analyzer that enforces rules for dependencies between software layers*⭐ = recommended*

Getting started
---------------

[](#getting-started)

```
composer require-dev spaceemotion/php-coding-standard

```

This will install the `phpcstd` binary to your vendor folder.

### Configuration via .phpcstd(.dist).ini

[](#configuration-via-phpcstddistini)

To minimize dependencies, `phpcstd` uses .ini-files for its configuration. If no `.phpcstd.ini` file can be found in your project folder, a `.phpcstd.dist.ini` file will be used as fallback (if possible).

### Command options

[](#command-options)

```
Usage:
  run [options] [--] [...]

Arguments:
  files                 List of files to parse instead of the configured sources

Options:
  -s, --skip=SKIP       Disables the list of tools during the run (comma-separated list) (multiple values allowed)
  -o, --only=ONLY       Only executes the list of tools during the run (comma-separated list) (multiple values allowed)
      --continue        Run the next check even if the previous one failed
      --fix             Try to fix any linting errors
      --hide-source     Hides the "source" lines from console output
      --lint-staged     Uses "git diff" to determine staged files to lint
      --ci              Changes the output format to GithubActions for better CI integration
      --no-fail         Only returns with exit code 0, regardless of any errors/warnings
  -h, --help            Display help for the given command. When no command is given display help for the run command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

```

Instead of defining the files/folders directly (in either the config or as arguments), you can also pipe a list into it:

```
$ ls -A1 | vendor/bin/phpcstd

```

Git Hooks
---------

[](#git-hooks)

To not have to wait for CI pipelines to finish, you can use git hooks to run over the changed files before committing.

```
vendor/bin/phpcstd --lint-staged
```

CI-Support
----------

[](#ci-support)

### Github Actions

[](#github-actions)

The `--ci` flag returns a format that can be used by GithubActions to annotate commits and PRs (see [their documentation on how this works](https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers)).

[![example file change with an error](./img/github-annotation.png)](./img/github-annotation.png)

Development
-----------

[](#development)

### Using Docker

[](#using-docker)

1. Spin up the container using `GITHUB_PERSONAL_ACCESS_TOKEN= docker-compose up -d --build`
2. Run all commands using `docker-compose exec php `

### Using XDebug

[](#using-xdebug)

This project uses [composer/xdebug-handler](https://github.com/composer/xdebug-handler) to improve performance by disabling xdebug upon startup. To enable XDebug during development you need to set the following env variable: `PHPCSTD_ALLOW_XDEBUG=1` (as written in their README).

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 95.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/429147?v=4)[Leonie](/maintainers/spaceemotion)[@spaceemotion](https://github.com/spaceemotion)

---

Top Contributors

[![spaceemotion](https://avatars.githubusercontent.com/u/429147?v=4)](https://github.com/spaceemotion "spaceemotion (239 commits)")[![Kalipso0505](https://avatars.githubusercontent.com/u/3777168?v=4)](https://github.com/Kalipso0505 "Kalipso0505 (7 commits)")[![kenowessels](https://avatars.githubusercontent.com/u/1162201?v=4)](https://github.com/kenowessels "kenowessels (2 commits)")[![dotdash](https://avatars.githubusercontent.com/u/230962?v=4)](https://github.com/dotdash "dotdash (1 commits)")[![Dwarfex](https://avatars.githubusercontent.com/u/721721?v=4)](https://github.com/Dwarfex "Dwarfex (1 commits)")

---

Tags

analysisautomationcode-qualityhacktoberfestlintingphp

### Embed Badge

![Health badge](/badges/spaceemotion-php-coding-standard/health.svg)

```
[![Health](https://phpackages.com/badges/spaceemotion-php-coding-standard/health.svg)](https://phpackages.com/packages/spaceemotion-php-coding-standard)
```

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14429.2M361](/packages/dms-phpunit-arraysubset-asserts)[gong023/assert_chain

enable you to use phpunit assert with method chain

1478.9k3](/packages/gong023-assert-chain)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
