PHPackages                             symplify/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. symplify/coding-standard

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

symplify/coding-standard
========================

Set of Symplify rules for PHP\_CodeSniffer and PHP CS Fixer.

13.0.0(6mo ago)3787.9M—4.6%26[3 issues](https://github.com/symplify/coding-standard/issues)20MITPHPPHP &gt;=8.2CI passing

Since Dec 30Pushed 6mo ago11 watchersCompare

[ Source](https://github.com/symplify/coding-standard)[ Packagist](https://packagist.org/packages/symplify/coding-standard)[ Fund](https://www.paypal.me/rectorphp)[ GitHub Sponsors](https://github.com/tomasvotruba)[ RSS](/packages/symplify-coding-standard/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (12)Versions (726)Used By (20)

Coding Standard
===============

[](#coding-standard)

[![Downloads](https://camo.githubusercontent.com/1b53de30ac2210e67e5cb87b8e357bbeab3dd9753104f2fc52316acb635732c4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73796d706c6966792f636f64696e672d7374616e646172642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/symplify/coding-standard/stats)

Coding standard rules for clean, consistent, and readable PHP code. No configuration needed—just install and let it handle the rest.

They run best with [ECS](https://github.com/symplify/easy-coding-standard).

Install
-------

[](#install)

```
composer require symplify/coding-standard --dev
composer require phpecs/phpecs --dev
```

1. Register in ECS config:

```
 # ecs.php
 use Symplify\EasyCodingStandard\Config\ECSConfig;
 use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

 return ECSConfig::configure()
     ->withSets([SetList::SYMPLIFY]);
```

2. And run:

```
# dry-run without changes
vendor/bin/ecs

# apply changes
vendor/bin/ecs --fix
```

12 Rules to Keep Your Code Clean
================================

[](#12-rules-to-keep-your-code-clean)

ArrayListItemNewlineFixer
-------------------------

[](#arraylistitemnewlinefixer)

Indexed PHP array item has to have one line per item

- class: [`Symplify\CodingStandard\Fixer\ArrayNotation\ArrayListItemNewlineFixer`](../src/Fixer/ArrayNotation/ArrayListItemNewlineFixer.php)

```
-$value = ['simple' => 1, 'easy' => 2];
+$value = ['simple' => 1,
+'easy' => 2];
```

ArrayOpenerAndCloserNewlineFixer
--------------------------------

[](#arrayopenerandclosernewlinefixer)

Indexed PHP array opener \[ and closer \] must be on own line

- class: [`Symplify\CodingStandard\Fixer\ArrayNotation\ArrayOpenerAndCloserNewlineFixer`](../src/Fixer/ArrayNotation/ArrayOpenerAndCloserNewlineFixer.php)

```
-$items = [1 => 'Hey'];
+$items = [
+1 => 'Hey'
+];
```

BlankLineAfterStrictTypesFixer
------------------------------

[](#blanklineafterstricttypesfixer)

Strict type declaration has to be followed by empty line

- class: [`Symplify\CodingStandard\Fixer\Strict\BlankLineAfterStrictTypesFixer`](../src/Fixer/Strict/BlankLineAfterStrictTypesFixer.php)

```
 declare(strict_types=1);
+
 namespace App;
```

LineLengthFixer
---------------

[](#linelengthfixer)

Array items, method parameters, method call arguments, new arguments should be on same/standalone line to fit line length.

🔧 **configure it!**

- class: [`Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer`](../src/Fixer/LineLength/LineLengthFixer.php)

```
-function some($veryLong, $superLong, $oneMoreTime)
-{
+function some(
+    $veryLong,
+    $superLong,
+    $oneMoreTime
+) {
 }

-function another(
-    $short,
-    $now
-) {
+function another($short, $now) {
 }
```

MethodChainingNewlineFixer
--------------------------

[](#methodchainingnewlinefixer)

Each chain method call must be on own line

- class: [`Symplify\CodingStandard\Fixer\Spacing\MethodChainingNewlineFixer`](../src/Fixer/Spacing/MethodChainingNewlineFixer.php)

```
-$someClass->firstCall()->secondCall();
+$someClass->firstCall()
+->secondCall();
```

ParamReturnAndVarTagMalformsFixer
---------------------------------

[](#paramreturnandvartagmalformsfixer)

Fixes @param, @return, `@var` and inline `@var` annotations broken formats

- class: [`Symplify\CodingStandard\Fixer\Commenting\ParamReturnAndVarTagMalformsFixer`](../src/Fixer/Commenting/ParamReturnAndVarTagMalformsFixer.php)

```
 /**
- * @param string
+ * @param string $name
  */
 function getPerson($name)
 {
 }
```

RemovePropertyVariableNameDescriptionFixer
------------------------------------------

[](#removepropertyvariablenamedescriptionfixer)

Remove docblock descriptions which duplicate their property name

- class: [`Symplify\CodingStandard\Fixer\Annotation\RemovePropertyVariableNameDescriptionFixer`](../src/Fixer/Annotation/RemovePropertyVariableNameDescriptionFixer.php)

```
 /**
- * @var string $name
+ * @var string
  */
 private $name;
```

RemoveMethodNameDuplicateDescriptionFixer
-----------------------------------------

[](#removemethodnameduplicatedescriptionfixer)

Remove docblock descriptions which duplicate their method name

- class: [`Symplify\CodingStandard\Fixer\Annotation\RemoveRedundantDescriptionFixer`](../src/Fixer/Annotation/RemoveRedundantDescriptionFixer.php)

```
 /**
- * Get name
  *
  * @return string
  */
 function getName()
 {
 }
```

RemovePHPStormAnnotationFixer
-----------------------------

[](#removephpstormannotationfixer)

Remove "Created by PhpStorm" annotations

- class: [`Symplify\CodingStandard\Fixer\Annotation\RemovePHPStormAnnotationFixer`](../src/Fixer/Annotation/RemovePHPStormAnnotationFixer.php)

```
-/**
- * Created by PhpStorm.
- * User: ...
- * Date: 17/10/17
- * Time: 8:50 AM
- */
 class SomeClass
 {
 }
```

RemoveUselessDefaultCommentFixer
--------------------------------

[](#removeuselessdefaultcommentfixer)

Remove useless PHPStorm-generated `@todo` comments, redundant "Class XY" or "gets service" comments etc.

- class: [`Symplify\CodingStandard\Fixer\Commenting\RemoveUselessDefaultCommentFixer`](../src/Fixer/Commenting/RemoveUselessDefaultCommentFixer.php)

```
-/**
- * class SomeClass
- */
 class SomeClass
 {
-    /**
-     * SomeClass Constructor.
-     */
     public function __construct()
     {
-        // TODO: Change the autogenerated stub
-        // TODO: Implement whatever() method.
     }
 }
```

SpaceAfterCommaHereNowDocFixer
------------------------------

[](#spaceaftercommaherenowdocfixer)

Add space after nowdoc and heredoc keyword, to prevent bugs on PHP 7.2 and lower, see

- class: [`Symplify\CodingStandard\Fixer\Spacing\SpaceAfterCommaHereNowDocFixer`](../src/Fixer/Spacing/SpaceAfterCommaHereNowDocFixer.php)

```
 $values = [
      'Peter',
+    2 => 'Paul'
+];
```

StandaloneLinePromotedPropertyFixer
-----------------------------------

[](#standalonelinepromotedpropertyfixer)

Promoted property should be on standalone line

- class: [`Symplify\CodingStandard\Fixer\Spacing\StandaloneLinePromotedPropertyFixer`](../src/Fixer/Spacing/StandaloneLinePromotedPropertyFixer.php)

```
 final class PromotedProperties
 {
-    public function __construct(public int $age, private string $name)
-    {
+    public function __construct(
+        public int $age,
+        private string $name
+    ) {
     }
 }
```

###  Health Score

70

—

ExcellentBetter than 100% of packages

Maintenance66

Regular maintenance activity

Popularity64

Solid adoption and visibility

Community39

Small or concentrated contributor base

Maturity95

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 82.2% 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.

###  Release Activity

Cadence

Every ~5 days

Recently: every ~42 days

Total

725

Last Release

200d ago

Major Versions

9.4.70 → 10.0.0-beta12021-11-02

10.3.3 → 11.0.02022-06-13

8.3.49 → 11.1.332023-01-09

11.4.1 → 12.0.02023-07-25

12.5.0 → 13.0.02025-10-30

PHP version history (11 changes)v0.0.1PHP &gt;=5.6

v0.0.2PHP ^5.6|^7.0

v0.1.4PHP ^7.0

v1.4.0PHP ^7.1

v7.0.0PHP ^7.2

8.2.17PHP ^7.2|^8.0

8.3.0PHP &gt;=7.2

9.0.0-rc1PHP &gt;=7.3

v9.3.27PHP &gt;=8.0

11.1.11PHP &gt;=8.1

12.1.0PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/924196?v=4)[Tomas Votruba](/maintainers/TomasVotruba)[@TomasVotruba](https://github.com/TomasVotruba)

---

Top Contributors

[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (518 commits)")[![TomasVotruba](https://avatars.githubusercontent.com/u/924196?v=4)](https://github.com/TomasVotruba "TomasVotruba (80 commits)")[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (22 commits)")[![gnutix](https://avatars.githubusercontent.com/u/310134?v=4)](https://github.com/gnutix "gnutix (2 commits)")[![parth391](https://avatars.githubusercontent.com/u/4966579?v=4)](https://github.com/parth391 "parth391 (1 commits)")[![ruudk](https://avatars.githubusercontent.com/u/104180?v=4)](https://github.com/ruudk "ruudk (1 commits)")[![rvanvelzen](https://avatars.githubusercontent.com/u/102603?v=4)](https://github.com/rvanvelzen "rvanvelzen (1 commits)")[![Wirone](https://avatars.githubusercontent.com/u/600668?v=4)](https://github.com/Wirone "Wirone (1 commits)")[![zonuexe](https://avatars.githubusercontent.com/u/822086?v=4)](https://github.com/zonuexe "zonuexe (1 commits)")[![bytehead](https://avatars.githubusercontent.com/u/754921?v=4)](https://github.com/bytehead "bytehead (1 commits)")[![clxmstaab](https://avatars.githubusercontent.com/u/47448731?v=4)](https://github.com/clxmstaab "clxmstaab (1 commits)")[![MatTheCat](https://avatars.githubusercontent.com/u/1898254?v=4)](https://github.com/MatTheCat "MatTheCat (1 commits)")

---

Tags

coding-standardcoding-styleecsphp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[kubawerlos/php-cs-fixer-custom-fixers

A set of custom fixers for PHP CS Fixer

23812.0M145](/packages/kubawerlos-php-cs-fixer-custom-fixers)[ergebnis/php-cs-fixer-config

Provides a configuration factory and rule set factories for friendsofphp/php-cs-fixer.

692.9M163](/packages/ergebnis-php-cs-fixer-config)[erickskrauch/php-cs-fixer-custom-fixers

A set of custom fixers for PHP-CS-Fixer

302.1M18](/packages/erickskrauch-php-cs-fixer-custom-fixers)

PHPackages © 2026

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