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

ActivePhpcodesniffer-standard[Testing &amp; Quality](/categories/testing)

swivl/php-coding-standard
=========================

Swivl Coding Standard for PHP\_CodeSniffer

v2.0.0(7mo ago)349.6k↓74.7%27MITPHPPHP &gt;=7.2CI passing

Since Sep 19Pushed 7mo ago8 watchersCompare

[ Source](https://github.com/Swivl/php-coding-standard)[ Packagist](https://packagist.org/packages/swivl/php-coding-standard)[ Docs](https://github.com/Swivl/php-coding-standard)[ RSS](/packages/swivl-php-coding-standard/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (1)Versions (23)Used By (7)

Swivl Coding Standard for PHP\_CodeSniffer
==========================================

[](#swivl-coding-standard-for-php_codesniffer)

This coding standard is much more strict version of [PSR-12](https://www.php-fig.org/psr/psr-12/).

Installation
------------

[](#installation)

Install coding standard using composer:

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

Configuration
-------------

[](#configuration)

Create file `phpcs.xml.dist` in the root of your project with the content similar to:

```

        */src/Migrations/*

    src/
    tests/

    */Resources/*

```

Configure your IDE to use `phpcs.xml.dist` as the default ruleset for PHP\_CodeSniffer.

Checking code style in your project
-----------------------------------

[](#checking-code-style-in-your-project)

Check the whole project:

```
bin/phpcs
```

Check a single file or directory:

```
bin/phpcs path/to/file/or/directory
```

Automatically fix errors:

```
bin/phpcbf
```

Advanced configuration
----------------------

[](#advanced-configuration)

#### `Swivl.Commenting.DoctrineEntity`

[](#swivlcommentingdoctrineentity)

This sniff provides the following options:

```

```

- `concreteTypeToBaseTypeMap` - when column is mapped to concrete type FeedItemComment, but modification methods are type hinted with base class CommentInterface
- `useDynamicalCalculationForEnumColumnType` - when enum is mapped to some PHP type. For example, `type="auth_enum_type"` is mapped to PHP AuthType.

#### `Swivl.Commenting.FunctionComment`

[](#swivlcommentingfunctioncomment)

This sniff provides the option:

```

```

- `requiredPhpdoc` - configures when PHPDoc is required for a method. Possible values:
    - `always` - PHPDoc is required for all methods.
    - `map` - PHPDoc is required for a method if at least 1 type hint or return type is in the list which is defined in the sniff in FunctionCommentSniff::REQUIRED\_PHPDOC\_MAP. It is the default behavior.
    - `never` - PHPDoc isn't required for all methods.

#### `Swivl.Functions.ConstructorPropertyPromotion`

[](#swivlfunctionsconstructorpropertypromotion)

This sniff provides the following options:

```

```

#### `Swivl.Commenting.UselessFunctionComment`

[](#swivlcommentinguselessfunctioncomment)

This sniff provides the following options:

```

```

#### `Swivl.Commenting.UselessClassComment`

[](#swivlcommentinguselessclasscomment)

This sniff provides the following options:

```

```

Dependencies update
-------------------

[](#dependencies-update)

Some sniffs from Swivl Coding Standard override sniffs from libraries which are in dependencies list. The following sniffs should be synchronized with the original code during dependencies update:

- [Swivl\\Sniffs\\Commenting\\FunctionCommentSniff](Swivl/Sniffs/Commenting/FunctionCommentSniff.php)
- [Swivl\\Sniffs\\Functions\\MultiLineFunctionDeclarationSniff](Swivl/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php)
- [Swivl\\Sniffs\\Namespaces\\NamespaceDeclarationSniff](Swivl/Sniffs/Namespaces/NamespaceDeclarationSniff.php)

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance63

Regular maintenance activity

Popularity32

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 88% 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 ~107 days

Recently: every ~84 days

Total

22

Last Release

226d ago

Major Versions

v1.6.2 → v2.0.02025-11-19

PHP version history (2 changes)v1.0.0PHP &gt;=7.1

v2.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e4ae642c5f1ad16c9b07e976096123f9ef8d50ee7df05123ed1e7f55b29caa9?d=identicon)[javer](/maintainers/javer)

---

Top Contributors

[![javer](https://avatars.githubusercontent.com/u/591296?v=4)](https://github.com/javer "javer (44 commits)")[![manowark](https://avatars.githubusercontent.com/u/4329477?v=4)](https://github.com/manowark "manowark (4 commits)")[![Fighter77777](https://avatars.githubusercontent.com/u/5434253?v=4)](https://github.com/Fighter77777 "Fighter77777 (1 commits)")[![RomanZubach](https://avatars.githubusercontent.com/u/82503039?v=4)](https://github.com/RomanZubach "RomanZubach (1 commits)")

---

Tags

phpcssymfonyCoding StandardSwivl

### Embed Badge

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

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

###  Alternatives

[slevomat/coding-standard

Slevomat Coding Standard for PHP\_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.

1.5k134.0M2.3k](/packages/slevomat-coding-standard)[escapestudios/symfony2-coding-standard

CodeSniffer ruleset for the Symfony 2+ coding standard

40611.5M301](/packages/escapestudios-symfony2-coding-standard)[consistence/coding-standard

Consistence - Coding Standard - PHP Code Sniffer rules

76842.7k94](/packages/consistence-coding-standard)[webimpress/coding-standard

Webimpress Coding Standard

152.3M41](/packages/webimpress-coding-standard)[mreduar/laravel-phpcs

PHP Codesniffer ruleset to follow Laravel's coding style

3917.6k1](/packages/mreduar-laravel-phpcs)[endouble/symfony3-custom-coding-standard

Customized CodeSniffer ruleset for the Symfony3 projects

13108.7k1](/packages/endouble-symfony3-custom-coding-standard)

PHPackages © 2026

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