PHPackages                             inpsyde/php-coding-standards - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. inpsyde/php-coding-standards

ActivePhpcodesniffer-standard[PSR &amp; Standards](/categories/psr-standards)

inpsyde/php-coding-standards
============================

PHP 7.4+ coding standards for Syde WordPress projects.

2.0.2(10mo ago)101169.9k↑48.3%23[1 PRs](https://github.com/inpsyde/php-coding-standards/pulls)20MITPHPPHP &gt;=7.4CI passing

Since Jun 21Pushed 1mo ago4 watchersCompare

[ Source](https://github.com/inpsyde/php-coding-standards)[ Packagist](https://packagist.org/packages/inpsyde/php-coding-standards)[ RSS](/packages/inpsyde-php-coding-standards/feed)WikiDiscussions version/2 Synced 1w ago

READMEChangelog (10)Dependencies (8)Versions (48)Used By (20)

Syde PHP Coding Standards
=========================

[](#syde-php-coding-standards)

> PHP 7.4+ coding standards for Syde WordPress projects.

[![PHP Quality Assurance](https://github.com/inpsyde/php-coding-standards/workflows/PHP%20Quality%20Assurance/badge.svg)](https://github.com/inpsyde/php-coding-standards/workflows/PHP%20Quality%20Assurance/badge.svg)

---

Important

Please note that development on **this package has shifted to maintenance mode** only. We remain committed to fixing bugs, ensuring compatibility, and addressing security concerns **until July 31, 2025**. New features are not planned at this time. Maintenance mode will end on August 1, 2025, effectively marking the End-of-Life date of this package.

For active projects, we **strongly recommend migrating to [`syde/phpcs`](https://github.com/inpsyde/phpcs)**, the next-generation Syde PHP Coding Standards for WordPress development at scale, supporting PHP 8.1+. Please refer to the dedicated [Migration](https://github.com/inpsyde/phpcs/blob/main/docs/Migration.md) docs to get a high-level understanding of the potential migration effort.

---

Usage
=====

[](#usage)

When the package is installed via Composer, and dependencies are updated, everything is ready and the coding standards can be checked via:

```
vendor/bin/phpcs --standard="Inpsyde"
```

Here, `` is at least one file or directory to check, for example:

```
vendor/bin/phpcs --standard="Inpsyde" ./src/ ./my-plugin.php
```

There are many options that can be used to customise the behavior of the command, to get documentation use:

```
vendor/bin/phpcs --help
```

Configuration File
------------------

[](#configuration-file)

A `phpcs.xml.dist` file can be used to avoid passing many arguments via the command line. For example:

```

    My Project coding standard.

    ./src
    ./tests/src

```

Such a configuration allows to run the code style check like so:

```
vendor/bin/phpcs
```

Moreover, thanks to the `text_domain` setting, PHP\_CodeSniffer will also check that all WordPress internationalization functions are called with the proper text domain.

---

Included rules
==============

[](#included-rules)

For the detailed lists of included rules, refer to [`ruleset.xml`](./Inpsyde/ruleset.xml).

PSR-1, PSR-2, PSR-12
--------------------

[](#psr-1-psr-2-psr-12)

For more information about included rules from PHP Standards Recommendations (PSR), refer to the official documentation:

- [PSR-1](https://www.php-fig.org/psr/psr-1)
- [PSR-2](https://www.php-fig.org/psr/psr-2)
- [PSR-12](https://www.php-fig.org/psr/psr-12)

WordPress Coding Standards
--------------------------

[](#wordpress-coding-standards)

To ensure code quality, and compatibility with WordPress VIP, some rules have been included from:

- [WordPress Coding Standards](https://github.com/WordPress/WordPress-Coding-Standards)
- [VIP Coding Standards](https://github.com/Automattic/VIP-Coding-Standards)

Slevomat
--------

[](#slevomat)

A few rules have been included from the [Slevomat Coding Standard](https://github.com/slevomat/coding-standard).

PHPCompatibility
----------------

[](#phpcompatibility)

For PHP cross-version compatibility checks, the full [PHP Compatibility Coding Standard for PHP CodeSniffer](https://github.com/PHPCompatibility/PHPCompatibility)standard has been included.

The target PHP version (range) can be changed via a [custom `phpcs.xml` file](https://github.com/PHPCompatibility/PHPCompatibility/blob/9.3.5/README.md#using-a-custom-ruleset).

Generic Rules
-------------

[](#generic-rules)

Some rules are also included from PHP\_CodeSniffer itself, as well as [PHPCSExtra](https://github.com/PHPCSStandards/PHPCSExtra).

Custom Rules
------------

[](#custom-rules)

The following custom rules are in use:

Sniff NameDescriptionHas ConfigAuto-Fixable`ArgumentTypeDeclaration`Enforce argument type declaration.`DisableCallUserFunc`Disable usage of `call_user_func`.`DisableMagicSerialize`Disable usage of `__sleep`, `__wakeup`.`DisableSerializeInterface`Disable usage of `Serializable` interface.`DisallowShortOpenTag`Disallow short open PHP tag (short echo tag allowed).`ElementNameMinimalLength`Use minimum 3 chars for names (with a few exclusions)✓`EncodingComment`Detect usage of opening `-*- coding: utf-8 -*-`✓✓`ForbiddenPublicProperty`No public class properties`FunctionBodyStart`Handle blank line at start of function body.✓`FunctionLength`Max 50 lines per function/method, excluding blank lines and comments-only lines.✓`HookClosureReturn`Ensure that actions callbacks do not return anything, while filter callbacks return something.`HookPriority`Report usage of `PHP_INT_MAX` and `PHP_INT_MIN` as hook priority.`LineLength`Max 100 chars per line✓`NestingLevel`Max indent level of 3 inside functions✓`NoAccessors`Discourage usage of getters and setters.`NoElse`Discourage usage of `else`.`NoRootNamespaceFunctions`Report usage of global functions in the root namespace.`NoTopLevelDefine`Discourage usage of `define` where `const` is preferable.`PropertyPerClassLimit`Discourage usage of more than 10 properties per class.✓`Psr4`Check PSR-4 compliance✓`ReturnTypeDeclaration`Enforce return type declaration`StaticClosure`Points closures that can be `static`.✓`VariablesName`Check variable (and properties) names✓For **notes and configuration**, refer to the [`inpsyde-custom-sniffs.md`](/inpsyde-custom-sniffs.md)file in this repository.

---

Template Rules
--------------

[](#template-rules)

The `InpsydeTemplates` ruleset extends the standard `Inpsyde` ruleset with some template-specific sniffs.

The recommended way to use the `InpsydeTemplates` ruleset is as follows:

```

    ./src
    ./templates
    ./tests
    ./views

        */templates/*
        */views/*

```

The following template-specific rules are available:

Sniff NameDescriptionHas ConfigAuto-Fixable`AlternativeControlStructure`Encourage usage of alternative syntax with inline HTML.`ShortEchoTag`Replace echo with short echo tag in single-line statements.✓`TrailingSemicolon`Remove trailing semicolon before closing PHP tag.✓Removing or Disabling Rules
===========================

[](#removing-or-disabling-rules)

Rules Tree
----------

[](#rules-tree)

Sometimes it is necessary not to follow some rules. To avoid error reporting, it is possible to:

- remove rules for an entire project via configuration;
- disable rules from code, only is specific places.

In both cases, it is possible to remove or disable:

- a complete standard;
- a standard subset;
- a single sniff;
- a single rule.

These things are in a hierarchical relationship: *standards* are made of one or more *subsets*, which contain one or more *sniffs*, which in turn contain one or more *rules*.

Removing Rules via Configuration File
-------------------------------------

[](#removing-rules-via-configuration-file)

Rules can be removed for the entire project by using a custom `phpcs.xml` file, like this:

```

```

In the example above, the `PSR1.Classes.ClassDeclaration` sniff (and all the rules it contains) has been removed.

By using `PSR1` instead of `PSR1.Classes.ClassDeclaration`, one would remove the entire `PSR1`standard, whereas using `PSR1.Classes.ClassDeclaration.MultipleClasses` would remove this one rule only, but no other rules in the `PSR1.Classes.ClassDeclaration` sniff.

Removing Rules via Code Comments
--------------------------------

[](#removing-rules-via-code-comments)

Removing a rule/sniff/subset/standard only for a specific file or a part of it can be done by using special `phpcs` annotations/comments, for example, `// phpcs:disable` followed by an optional name of a standard/subset/sniff/rule. Like so:

```
// phpcs:disable PSR1.Classes.ClassDeclaration
```

For more information about ignoring files, please refer to the official [PHP\_CodeSniffer Wiki](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-parts-of-a-file).

---

IDE Integration
===============

[](#ide-integration)

PhpStorm
--------

[](#phpstorm)

After installing the package as explained above, open PhpStorm settings, and navigate to

`Language & Frameworks` -&gt; `PHP` -&gt; `Quality Tools` -&gt; `PHP_CodeSniffer`

Choose *"Local"* in the *"Configuration"* dropdown.

Click the *"..."* button next to the dropdown. It will show a dialog where you need to specify the path for the PHP\_CodeSniffer executable.

Open the file selection dialog, navigate to `vendor/bin/` in your project, and select `phpcs`. On Windows, choose `phpcs.bat`.

Click the *"Validate"* button next to the path input field. If everything is working fine, a success message will be shown at the bottom of the window.

Still in the PhpStorm settings, navigate to:

`Editor` -&gt; `Inspections`

Type `codesniffer` in the search field before the list of inspections, then select:

`PHP` -&gt; `Quality Tools` -&gt; `PHP_CodeSniffer validation`

Enable it using the checkbox in the list, press *"Apply"*.

Select *"PHP\_CodeSniffer validation"*, click the refresh icon next to the *"Coding standard"*dropdown on the right, and choose `Inpsyde`.

If you don't see `Inpsyde` here, you may need to specify the `phpcs.xml` file by selecting *"Custom"* as standard and then use the *"..."* button next to the dropdown.

Once the PhpStorm integration is complete, warnings and errors in your code will automatically be shown in your IDE editor.

---

Installation
============

[](#installation)

Via Composer, require as development dependency:

```
composer require --dev inpsyde/php-coding-standards
```

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance76

Regular maintenance activity

Popularity49

Moderate usage in the ecosystem

Community39

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

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

Recently: every ~84 days

Total

44

Last Release

302d ago

Major Versions

0.13.4 → 1.0.0-beta.12020-04-13

1.0.0 → 2.0.0-beta.12023-11-17

PHP version history (3 changes)0.12.0PHP &gt;=7.0

1.0.0-RC.1PHP &gt;=7

2.0.0-beta.1PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/003585053f7d5d2127d31d5a4e79ba309acc075154f5752de8f429ac42c54dbe?d=identicon)[Syde](/maintainers/Syde)

![](https://avatars.githubusercontent.com/u/3417446?v=4)[Christian Leucht](/maintainers/Chrico)[@Chrico](https://github.com/Chrico)

---

Top Contributors

[![gmazzap](https://avatars.githubusercontent.com/u/2208282?v=4)](https://github.com/gmazzap "gmazzap (308 commits)")[![tfrommen](https://avatars.githubusercontent.com/u/6049306?v=4)](https://github.com/tfrommen "tfrommen (25 commits)")[![shvlv](https://avatars.githubusercontent.com/u/3157352?v=4)](https://github.com/shvlv "shvlv (22 commits)")[![antonioeatgoat](https://avatars.githubusercontent.com/u/11173091?v=4)](https://github.com/antonioeatgoat "antonioeatgoat (20 commits)")[![Chrico](https://avatars.githubusercontent.com/u/3417446?v=4)](https://github.com/Chrico "Chrico (18 commits)")[![widoz](https://avatars.githubusercontent.com/u/1917784?v=4)](https://github.com/widoz "widoz (6 commits)")[![dnaber-de](https://avatars.githubusercontent.com/u/1133205?v=4)](https://github.com/dnaber-de "dnaber-de (5 commits)")[![luislard](https://avatars.githubusercontent.com/u/17932063?v=4)](https://github.com/luislard "luislard (3 commits)")[![AlexP11223](https://avatars.githubusercontent.com/u/5680466?v=4)](https://github.com/AlexP11223 "AlexP11223 (2 commits)")[![tyrann0us](https://avatars.githubusercontent.com/u/8144115?v=4)](https://github.com/tyrann0us "tyrann0us (2 commits)")[![meszarosrob](https://avatars.githubusercontent.com/u/6097856?v=4)](https://github.com/meszarosrob "meszarosrob (1 commits)")[![fsw](https://avatars.githubusercontent.com/u/784083?v=4)](https://github.com/fsw "fsw (1 commits)")[![cristianobaptista](https://avatars.githubusercontent.com/u/1046799?v=4)](https://github.com/cristianobaptista "cristianobaptista (1 commits)")[![bueltge](https://avatars.githubusercontent.com/u/133425?v=4)](https://github.com/bueltge "bueltge (1 commits)")[![GaryJones](https://avatars.githubusercontent.com/u/88371?v=4)](https://github.com/GaryJones "GaryJones (1 commits)")

---

Tags

codesnifferphpphpcsstyleguidewordpresswpcsstandardsphpcswordpressstatic analysisCode stylePSR-2coding-standardscoding-stylepsr-12code standardsPHP standardsWordPress standardsobject calisthenicsInpsydeSyde

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/inpsyde-php-coding-standards/health.svg)

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

###  Alternatives

[yoast/yoastcs

PHP\_CodeSniffer rules for Yoast projects

221.2M33](/packages/yoast-yoastcs)[automattic/vipwpcs

PHP\_CodeSniffer rules (sniffs) to enforce WordPress VIP minimum coding conventions

26110.9M179](/packages/automattic-vipwpcs)[syde/phpcs

Syde PHP coding standards for WordPress projects.

1024.3k8](/packages/syde-phpcs)[wp-cli/wp-cli-tests

WP-CLI testing framework

423.0M129](/packages/wp-cli-wp-cli-tests)[suin/phpcs-psr4-sniff

PHP\_CodeSniffer sniff that checks class name matches PSR-4 project structure.

281.9M18](/packages/suin-phpcs-psr4-sniff)[mayflower/mo4-coding-standard

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

17524.8k7](/packages/mayflower-mo4-coding-standard)

PHPackages © 2026

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