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.

19139.6k—1.7%7[5 issues](https://github.com/spaceemotion/php-coding-standard/issues)[2 PRs](https://github.com/spaceemotion/php-coding-standard/pulls)6PHP

Since Dec 15Pushed 1y 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 1mo ago

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

31

—

LowBetter than 68% of packages

Maintenance21

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://www.gravatar.com/avatar/ecbefb008d464a9b6b2bf00c5feae98bc7ca09ccc92feec742ade5ce16956b1b?d=identicon)[spaceemotion](/maintainers/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

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[phpspec/phpspec

Specification-oriented BDD framework for PHP 7.1+

1.9k36.7M3.1k](/packages/phpspec-phpspec)

PHPackages © 2026

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