PHPackages                             laminas/laminas-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. laminas/laminas-coding-standard

ActivePhpcodesniffer-standard[Utility &amp; Helpers](/categories/utility)

laminas/laminas-coding-standard
===============================

Laminas Coding Standard

3.1.0(1y ago)331.7M↑10.4%17[5 issues](https://github.com/laminas/laminas-coding-standard/issues)[2 PRs](https://github.com/laminas/laminas-coding-standard/pulls)20BSD-3-ClausePHPPHP ^7.4 || ^8.0CI passing

Since Dec 31Pushed 3mo ago16 watchersCompare

[ Source](https://github.com/laminas/laminas-coding-standard)[ Packagist](https://packagist.org/packages/laminas/laminas-coding-standard)[ Docs](https://laminas.dev)[ Fund](https://funding.communitybridge.org/projects/laminas-project)[ RSS](/packages/laminas-laminas-coding-standard/feed)WikiDiscussions 3.2.x Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (33)Used By (20)

laminas-coding-standard
=======================

[](#laminas-coding-standard)

[![Build Status](https://github.com/laminas/laminas-coding-standard/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/laminas/laminas-coding-standard/actions/workflows/continuous-integration.yml)

> ## 🇷🇺 Русским гражданам
>
> [](#-русским-гражданам)
>
> Мы, участники Laminas, родились и живем в разных странах. У многих из нас есть друзья, родственники и коллеги как в России, так и в Украине. Некоторые из нас родились в России. Некоторые из нас живут в России. У некоторых бабушки и дедушки сражались с фашистами во Второй мировой войне. Здесь никто не поддерживает фашизм.
>
> У одного из нас есть украинская родственница, которая спаслась из дома вместе с сыном. Поезд задержался из-за бомбежки на дороге впереди. У нас есть друзья, которые прячутся в бомбоубежищах. Мы с тревогой ждем весточки от них после воздушных налетов, которые беспорядочно наносят удары и попадают по больницам, школам, детским садам и домам. Мы не берем это из каких-либо СМИ. Мы наблюдаем это напрямую.
>
> Вы доверяете нам достаточно, чтоб использовать наши программы, и мы просим вас довериться нам вновь. Мы нуждаемся в помощи. Выходите и протестуйте против этой бесполезной войны. Остановите кровопролитие. Скажите "Нет войне!"
>
> ## 🇺🇸 To Citizens of Russia
>
> [](#-to-citizens-of-russia)
>
> We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism.
>
> One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences.
>
> You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!"

The coding standard ruleset for Laminas components.

This specification extends and expands [PSR-12](https://www.php-fig.org/psr/psr-12), the extended coding style guide and requires adherence to [PSR-1](https://www.php-fig.org/psr/psr-1), the basic coding standard. These are minimal specifications and don't address all factors, including things like:

- whitespace around operators
- alignment of array keys and operators
- alignment of object operations
- how to format multi-line conditionals
- what and what not to import, and how
- etc.

Contributors have different coding styles and so do the maintainers. During code reviews there are regularly discussions about spaces and alignments, where and when was said that a function needs to be imported. And that's where this coding standard comes in: To have internal consistency in a component and between components.

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

[](#installation)

1. Install the module via composer by running:

    ```
    composer require --dev laminas/laminas-coding-standard
    ```
2. Add composer scripts into your `composer.json`:

    ```
    "scripts": {
      "cs-check": "phpcs",
      "cs-fix": "phpcbf"
    }
    ```
3. Create file `phpcs.xml` on base path of your repository with this content:

    ```

        config
        src
        test

    ```

You can add or exclude some locations in that file. For a reference please see: [https://github.com/PHPCSStandards/PHP\_CodeSniffer/wiki/Annotated-Ruleset](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-Ruleset)

Usage
-----

[](#usage)

- To run checks only:

    ```
    composer cs-check
    ```
- To automatically fix many CS issues:

    ```
    composer cs-fix
    ```

Ignoring parts of a File
------------------------

[](#ignoring-parts-of-a-file)

> Note: Before PHP\_CodeSniffer version 3.2.0, `// @codingStandardsIgnoreStart` and `// @codingStandardsIgnoreEnd` were used. These are deprecated and will be removed in PHP\_CodeSniffer version 4.0.

Disable parts of a file:

```
$xmlPackage = new XMLPackage;
// phpcs:disable
$xmlPackage['error_code'] = get_default_error_code_value();
$xmlPackage->send();
// phpcs:enable
```

Disable a specific rule:

```
// phpcs:disable Generic.Commenting.Todo.Found
$xmlPackage = new XMLPackage;
$xmlPackage['error_code'] = get_default_error_code_value();
// TODO: Add an error message here.
$xmlPackage->send();
// phpcs:enable
```

Ignore a specific violation:

```
$xmlPackage = new XMLPackage;
$xmlPackage['error_code'] = get_default_error_code_value();
// phpcs:ignore Generic.Commenting.Todo.Found
// TODO: Add an error message here.
$xmlPackage->send();
```

Development
-----------

[](#development)

> **New rules or Sniffs may not be introduced in minor or bugfix releases and should always be based on the develop branch and queued for the next major release, unless considered a bugfix for existing rules.**

If you want to test changes against Laminas components or your own projects, install your forked laminas-coding-standard globally with composer:

```
$ composer global config repositories.laminas-coding-standard vcs git@github.com:/laminas-coding-standard.git
$ composer global require --dev laminas/laminas-coding-standard:dev-

# For this to work, add this to your path: ~/.composer/vendor/bin
# Using `-s` prints the rules that triggered the errors so they can be reviewed easily. `-p` is for progress display.
$ phpcs -sp --standard=LaminasCodingStandard src test
```

Make sure you remove the global installation after testing from your global composer.json file!!!

Documentation can be previewed locally by installing [MkDocs](https://www.mkdocs.org/#installation) and run `mkdocs serve`. This will start a server where you can read the docs.

Reference
---------

[](#reference)

Rules can be added, excluded or tweaked locally, depending on your preferences. More information on how to do this can be found here:

- [Coding Standard Tutorial](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Coding-Standard-Tutorial)
- [Configuration Options](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options)
- [Selectively Applying Rules](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-Ruleset#selectively-applying-rules)
- [Customisable Sniff Properties](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Customisable-Sniff-Properties)

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance63

Regular maintenance activity

Popularity53

Moderate usage in the ecosystem

Community48

Growing community involvement

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 54.9% 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 ~74 days

Recently: every ~116 days

Total

31

Last Release

113d ago

Major Versions

1.0.0 → 2.0.0alpha22019-12-31

2.6.x-dev → 3.0.02024-10-11

3.1.x-dev → 4.0.x-dev2025-09-16

PHP version history (4 changes)2.0.0alpha1PHP ^7.1

2.1.1PHP ^7.3 || ~8.0.0

2.3.0PHP ^7.3 || ^8.0

2.4.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25943?v=4)[Matthew Weier O'Phinney](/maintainers/weierophinney)[@weierophinney](https://github.com/weierophinney)

---

Top Contributors

[![geerteltink](https://avatars.githubusercontent.com/u/9497586?v=4)](https://github.com/geerteltink "geerteltink (191 commits)")[![michalbundyra](https://avatars.githubusercontent.com/u/7423207?v=4)](https://github.com/michalbundyra "michalbundyra (48 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (32 commits)")[![gsteel](https://avatars.githubusercontent.com/u/2803720?v=4)](https://github.com/gsteel "gsteel (15 commits)")[![froschdesign](https://avatars.githubusercontent.com/u/103362?v=4)](https://github.com/froschdesign "froschdesign (11 commits)")[![laminas-bot](https://avatars.githubusercontent.com/u/68250880?v=4)](https://github.com/laminas-bot "laminas-bot (10 commits)")[![ghostwriter](https://avatars.githubusercontent.com/u/9754361?v=4)](https://github.com/ghostwriter "ghostwriter (10 commits)")[![boesing](https://avatars.githubusercontent.com/u/2189546?v=4)](https://github.com/boesing "boesing (9 commits)")[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (9 commits)")[![weierophinney](https://avatars.githubusercontent.com/u/25943?v=4)](https://github.com/weierophinney "weierophinney (4 commits)")[![gszy](https://avatars.githubusercontent.com/u/12767117?v=4)](https://github.com/gszy "gszy (1 commits)")[![autowp](https://avatars.githubusercontent.com/u/2299280?v=4)](https://github.com/autowp "autowp (1 commits)")[![Danack](https://avatars.githubusercontent.com/u/1505719?v=4)](https://github.com/Danack "Danack (1 commits)")[![grizzm0](https://avatars.githubusercontent.com/u/2905853?v=4)](https://github.com/grizzm0 "grizzm0 (1 commits)")[![alexraputa](https://avatars.githubusercontent.com/u/10957915?v=4)](https://github.com/alexraputa "alexraputa (1 commits)")[![jrfnl](https://avatars.githubusercontent.com/u/663378?v=4)](https://github.com/jrfnl "jrfnl (1 commits)")[![lcobucci](https://avatars.githubusercontent.com/u/201963?v=4)](https://github.com/lcobucci "lcobucci (1 commits)")[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (1 commits)")[![sommer-gei](https://avatars.githubusercontent.com/u/29099046?v=4)](https://github.com/sommer-gei "sommer-gei (1 commits)")

---

Tags

coding-standardslaminasCoding Standard

### Embed Badge

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

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

###  Alternatives

[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)
