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

Abandoned → [symplify/easy-coding-standard](/?search=symplify%2Feasy-coding-standard)Library[Testing &amp; Quality](/categories/testing)

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

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

13.1.1(3w ago)3838.1M↓22.9%2520MITPHPPHP &gt;=8.4CI passing

Since Dec 30Pushed 1w 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 today

READMEChangelog (3)Dependencies (23)Versions (731)Used By (20)

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

[](#coding-standard)

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

Warning

**This package is deprecated.** Use [Easy Coding Standard (ECS)](https://github.com/easy-coding-standard/easy-coding-standard) instead, where these rules and coding standard work out of the box—no extra setup needed.

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 symplify/easy-coding-standard --dev
```

1. Register in `ecs.php` config:

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

 return ECSConfig::configure()
    ->withPreparedSets(symplify: true);
```

2. And run:

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

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

23 Rules to Keep Your Code Clean
================================

[](#23-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();
```

Doc block malform rules
-----------------------

[](#doc-block-malform-rules)

Single-task rules that each fix one kind of `@param`/`@return`/`@var` malform. They are registered together in the [`docblock` set](../config/sets/docblock.php) and all handle the `@phpstan-` and `@psalm-` prefixed variants of these tags.

AddMissingParamNameFixer
------------------------

[](#addmissingparamnamefixer)

Add a missing variable name to a `@param` annotation

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

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

AddMissingVarNameFixer
----------------------

[](#addmissingvarnamefixer)

Add a missing variable name to an inline `@var` annotation

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

```
-/** @var int */
+/** @var int $value */
 $value = 1000;
```

DoubleAsteriskInlineVarFixer
----------------------------

[](#doubleasteriskinlinevarfixer)

Use a double asterisk `/**` doc block for an inline `@var` comment

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

```
-/* @var int $variable */
+/** @var int $variable */
 $variable = 5;
```

FixParamNameTypoFixer
---------------------

[](#fixparamnametypofixer)

Fix a typo in the `@param` variable name to match the real argument

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

```
 /**
  * @param string $one
- * @param string $twoTypo
+ * @param string $two
  */
 function anotherFunction(string $one, string $two)
 {
 }
```

RemoveDeadParamFixer
--------------------

[](#removedeadparamfixer)

Remove a dead `@param` line that has only a name and no type

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

```
 /**
  * @param string $name
- * @param $age
  */
 function withDeadParam(string $name, $age)
 {
 }
```

RemoveParamNameReferenceFixer
-----------------------------

[](#removeparamnamereferencefixer)

Remove the reference `&` from a `@param` variable name

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

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

RemoveSuperfluousReturnNameFixer
--------------------------------

[](#removesuperfluousreturnnamefixer)

Remove a superfluous variable name from a `@return` annotation

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

```
 /**
- * @return int $value
+ * @return int
  */
 function function1(): int
 {
 }
```

RemoveSuperfluousVarNameFixer
-----------------------------

[](#removesuperfluousvarnamefixer)

Remove a superfluous variable name from a property `@var` annotation

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

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

SingleLineInlineVarDocBlockFixer
--------------------------------

[](#singlelineinlinevardocblockfixer)

Collapse a multi-line inline `@var` doc block into a single line

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

```
-/**
- * @var int $value
- */
+/** @var int $value */
 $value = 1000;
```

SwitchedTypeAndNameFixer
------------------------

[](#switchedtypeandnamefixer)

Reorder switched type and variable name in `@param`/`@var` annotation

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

```
 /**
- * @param $a string
- * @param $b string|null
+ * @param string $a
+ * @param string|null $b
  */
 function test($a, string $b = null): string
 {
 }
```

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\RemoveMethodNameDuplicateDescriptionFixer`](../src/Fixer/Annotation/RemoveMethodNameDuplicateDescriptionFixer.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.
     }
 }
```

It also removes "Class representing XY" comments:

```
-/**
- * Class representing TeamPlayer
- */
 class TeamPlayer
 {
 }
```

Comments that only repeat the class name are removed:

```
-/**
- * TeamPlayer
- */
 class TeamPlayer
 {
 }
```

As well as the default doc block generated by the Doctrine ORM:

```
-/**
- * This class was generated by the Doctrine ORM. Add your own custom
- * repository methods below.
- */
 class SomeRepository
 {
 }
```

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

79

↑

ExcellentBetter than 100% of packages

Maintenance97

Actively maintained with recent releases

Popularity63

Solid adoption and visibility

Community40

Growing community involvement

Maturity100

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 80.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 ~56 days

Total

728

Last Release

24d 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 (12 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

13.1.0PHP &gt;=8.4

### 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 (90 commits)")[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (22 commits)")[![rector-bot](https://avatars.githubusercontent.com/u/291251500?v=4)](https://github.com/rector-bot "rector-bot (6 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)")[![clxmstaab](https://avatars.githubusercontent.com/u/47448731?v=4)](https://github.com/clxmstaab "clxmstaab (1 commits)")[![bytehead](https://avatars.githubusercontent.com/u/754921?v=4)](https://github.com/bytehead "bytehead (1 commits)")[![Wirone](https://avatars.githubusercontent.com/u/600668?v=4)](https://github.com/Wirone "Wirone (1 commits)")[![MatTheCat](https://avatars.githubusercontent.com/u/1898254?v=4)](https://github.com/MatTheCat "MatTheCat (1 commits)")[![zonuexe](https://avatars.githubusercontent.com/u/822086?v=4)](https://github.com/zonuexe "zonuexe (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

[symplify/phpstan-rules

Set of Symplify rules, type extensions and error formatter for PHPStan

26812.7M334](/packages/symplify-phpstan-rules)[kubawerlos/php-cs-fixer-custom-fixers

A set of custom fixers for PHP CS Fixer

24013.1M202](/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.

703.0M205](/packages/ergebnis-php-cs-fixer-config)[tomasvotruba/type-coverage

Measure type coverage of your project

21511.0M398](/packages/tomasvotruba-type-coverage)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136406.3k14](/packages/rector-rector-src)

PHPackages © 2026

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