PHPackages                             pixelfederation/coding-standards - 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. pixelfederation/coding-standards

ActivePhpcodesniffer-standard

pixelfederation/coding-standards
================================

Standardized PHPCS sniffs for backend developers.

5.5.1(3mo ago)279.2k↓32.6%[1 issues](https://github.com/pixelfederation/coding-standards/issues)3BSD-3-ClausePHPPHP ^8.3CI passing

Since Jun 30Pushed 3mo ago5 watchersCompare

[ Source](https://github.com/pixelfederation/coding-standards)[ Packagist](https://packagist.org/packages/pixelfederation/coding-standards)[ Docs](https://github.com/pixelfederation/coding-standards)[ RSS](/packages/pixelfederation-coding-standards/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (24)Used By (3)

Coding standards
================

[](#coding-standards)

This package provides PHPCS rule set for coding standards in Pixel Federation. It should be included into each project maintained by Pixel Federation that uses PHP Code Sniffer [PHPCS](https://github.com/squizlabs/PHP_CodeSniffer).

Migration from v4 to v4.1.0
---------------------------

[](#migration-from-v4-to-v410)

Generic ruleset was removed. Now there are only rulesets for specific PHP versions.

Replace (in your ruleset) reference to file `vendor/pixelfederation/coding-standards/phpcs.ruleset.xml`with `vendor/pixelfederation/coding-standards/phpcs.ruleset.84.xml`for PHP 8.4.

How to use
----------

[](#how-to-use)

### Install composer dependencies

[](#install-composer-dependencies)

```
composer require --dev pixelfederation/coding-standards:^5.0
```

### Supported versions

[](#supported-versions)

For each php version there are 2 versions of the ruleset. One for DDD projects and one for Non-DDD projects.

For example for PHP 8.4:

```
vendor/pixelfederation/coding-standards/phpcs.ruleset.84.xml
OR
vendor/pixelfederation/coding-standards/phpcs.ruleset.84.non-ddd.xml

```

### Ruleset creation

[](#ruleset-creation)

Create a file named `phpcs.ruleset.xml` in the root folder of your project with the following content:

```

  PixelFederation rule set.

  tests/

```

### Running checks

[](#running-checks)

In your project directory run this command:

```
vendor/bin/phpcs --standard=phpcs.ruleset.xml src
```

### Automatically fixing errors

[](#automatically-fixing-errors)

In your project directory run this command:

```
vendor/bin/phpcbf --standard=phpcs.ruleset.xml src
```

Additional links
----------------

[](#additional-links)

Sniffs documentation for slevomat coding standards are here:

GrumPHP
=======

[](#grumphp)

❗**Note:** Custom tasks don’t work when using `phpro/grumphp-shim` (PHAR) with `parallel.enabled: true` due to class serialization limitations. If you need custom tasks, install GrumPHP via Composer.

Tasks
-----

[](#tasks)

### Installation

[](#installation)

```
# grumphp.yml
grumphp:
    extensions:
        - PixelFederation\CodingStandards\GrumPHP\ExtensionLoader
```

### Doctrine ORM Mapping Validation

[](#doctrine-orm-mapping-validation)

```
# grumphp.yml
grumphp:
    tasks:
        doctrine_schema_validate:
            skip_mapping: false
            skip_sync: false
            skip_property_types: false
            em: default
            triggered_by: ['php', 'xml', 'yml']
```

For multiple entity managers you can specify the entity manager to be used:

```
# grumphp.yml
grumphp:
    tasks:
        doctrine_schema_validate_application:
            em: application
            metadata:
                task: doctrine_schema_validate
        doctrine_schema_validate_reporting:
            em: reporting
            metadata:
                task: doctrine_schema_validate
```

**console\_path**

*Default: 'bin/console'*

With this parameter you can set the path of the console to be used.

**skip\_mapping**

*Default: false*

With this parameter you can skip the mapping validation check.

**skip\_sync**

*Default: false*

With this parameter you can skip checking if the mapping is in sync with the database.

**triggered\_by**

*Default: \[php, xml, yml\]*

This is a list of extensions that should trigger the Doctrine task.

**em**

*Default: null*

Require `doctrine/orm >= 3.0`. Specify the entity manager to be used. If not set, the default entity manager will be used.

**skip\_property\_types**

*Default: null*

Require `doctrine/orm >= 3.0`. With this parameter you can skip checking if property types match the Doctrine types.

### Composer Install Check

[](#composer-install-check)

```
# grumphp.yml
grumphp:
    tasks:
        composer_install_check:
            script: './vendor/pixelfederation/coding-standards/bin/composer_install_check.sh',
            ignore_patterns: []
            triggered_by: ['php', 'yml', 'yaml', 'xml']
            whitelist_patterns: []
            metadata:
                priority: 900
```

**script**

*Default: './bin/composer\_install\_check.sh'*

Path to check script.

**ignore\_patterns**

*Default: \[\]*

This is a list of patterns that will be ignored by phpcs. With this option you can skip files like tests. Leave this option blank to run phpcs for every php file.

**triggered\_by**

*Default: \['php', 'yml', 'yaml', 'xml'\]*

This is a list of extensions to be sniffed.

**whitelist\_patterns**

*Default: \[\]*

This is a list of regex patterns that will filter files to validate. With this option you can skip files like tests. This option is used in relation with the parameter `triggered_by`.

### PhpMd Extended

[](#phpmd-extended)

Extends the default [PhpMd task](vendor/phpro/grumphp/doc/tasks/phpmd.md) and splits the files into smaller chunks to prevent the `Argument list too long` error.

***Config***

The task lives under the `phpmd_extended` namespace and has following configurable parameters:

```
# grumphp.yml
grumphp:
    tasks:
        phpmd_extended:
            whitelist_patterns: []
            exclude: []
            report_format: text
            ruleset: ['cleancode', 'codesize', 'naming']
            triggered_by: ['php']
            chunks_size: 1000
```

**chunk\_size**

*Default: 1000*

This parameter defines how many files will be checked in one execution of phpmd. This can help with performance on large codebases.

### PHPStan Extended

[](#phpstan-extended)

Extends the default [PHPStan task](vendor/phpro/grumphp/doc/tasks/phpstan.md) and splits the files into smaller chunks to prevent the `Argument list too long` error.

***Config***

The task lives under the `phpstan_extended` namespace and has following configurable parameters:

```
# grumphp.yml
grumphp:
    tasks:
        phpstan_extended:
            autoload_file: ~
            chunk_size: 1000
            configuration: ~
            level: null
            force_patterns: []
            ignore_patterns: []
            triggered_by: ['php']
            memory_limit: "-1"
            use_grumphp_paths: true
```

**chunk\_size**

*Default: 1000*

This parameter defines how many files will be checked in one execution of phpstan. This can help with performance on large codebases.

### XmlLint Extended

[](#xmllint-extended)

Extends the default [XmlLint task](vendor/phpro/grumphp/doc/tasks/xmllint.md) with strict schema validation. Require `ext-dom` and `ext-libxml` extensions.

***Config***

It lives under the `xmllint_extended` namespace and has following configurable parameters:

```
# grumphp.yml
grumphp:
    tasks:
        xmllint_extended:
            ignore_patterns: []
            load_from_net: false
            x_include: false
            dtd_validation: false
            scheme_validation: false
            triggered_by: ['xml']
```

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance70

Regular maintenance activity

Popularity32

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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.

###  Release Activity

Cadence

Every ~102 days

Recently: every ~14 days

Total

21

Last Release

105d ago

Major Versions

1.0.5 → 2.0.02021-07-12

2.1.0 → 3.0.02024-05-23

3.0.0 → 4.0.02024-11-26

4.1.1 → 5.0.02025-10-22

PHP version history (4 changes)1.0.0PHP &gt;=7.2

3.0.0PHP ~7.4.0|^8.1

4.0.0PHP ^8.1

5.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f41a9b6b3fcc495a546791e3993b29832b7a4b08f34ad094a1131e2e8784d01?d=identicon)[pixelfederation](/maintainers/pixelfederation)

---

Top Contributors

[![majoskorec](https://avatars.githubusercontent.com/u/10130278?v=4)](https://github.com/majoskorec "majoskorec (6 commits)")[![mskorupa-pixel](https://avatars.githubusercontent.com/u/141940674?v=4)](https://github.com/mskorupa-pixel "mskorupa-pixel (5 commits)")[![pmysiak](https://avatars.githubusercontent.com/u/1159674?v=4)](https://github.com/pmysiak "pmysiak (5 commits)")[![thomasooo](https://avatars.githubusercontent.com/u/7643999?v=4)](https://github.com/thomasooo "thomasooo (3 commits)")

---

Tags

coding-standardsphpphpcs

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/pixelfederation-coding-standards/health.svg)

```
[![Health](https://phpackages.com/badges/pixelfederation-coding-standards/health.svg)](https://phpackages.com/packages/pixelfederation-coding-standards)
```

###  Alternatives

[drupal/coder

Coder is a library to review Drupal code.

3043.6M461](/packages/drupal-coder)[yoast/yoastcs

PHP\_CodeSniffer rules for Yoast projects

221.1M29](/packages/yoast-yoastcs)[mayflower/mo4-coding-standard

PHP CodeSniffer ruleset implementing the MO4 coding standards extending the Symfony coding standards.

17508.3k5](/packages/mayflower-mo4-coding-standard)[shopsys/coding-standards

Coding standards definition compatible with PSR-2

20269.1k13](/packages/shopsys-coding-standards)

PHPackages © 2026

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