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

ActivePhpcodesniffer-standard

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

Swivl Coding Standard for PHP\_CodeSniffer

v2.0.0(6mo ago)348.1k↓42.5%27MITPHPPHP &gt;=7.2CI passing

Since Sep 19Pushed 6mo 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 1mo ago

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

49

—

FairBetter than 95% of packages

Maintenance69

Regular maintenance activity

Popularity33

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity62

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

180d 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

[escapestudios/symfony2-coding-standard

CodeSniffer ruleset for the Symfony 2+ coding standard

40611.1M275](/packages/escapestudios-symfony2-coding-standard)[mayflower/mo4-coding-standard

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

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

Strict PHP coding standard

19193.5k62](/packages/orisai-coding-standard)[mreduar/laravel-phpcs

PHP Codesniffer ruleset to follow Laravel's coding style

3817.3k1](/packages/mreduar-laravel-phpcs)[secl-group/phpcs-secl-standard

A PHP\_CodeSniffer maintainability standard for Secl Group applications

149.7k](/packages/secl-group-phpcs-secl-standard)

PHPackages © 2026

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