PHPackages                             joomla/cms-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. joomla/cms-coding-standards

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

joomla/cms-coding-standards
===========================

Extended Joomla Coding Standards for the Joomla CMS application

2.0.0-alpha2(6y ago)992.2k↓28.3%6[1 issues](https://github.com/joomla/cms-coding-standards/issues)GPL-2.0-or-laterPHP &gt;=5.3.10

Since Jun 25Pushed 2y ago6 watchersCompare

[ Source](https://github.com/joomla/cms-coding-standards)[ Packagist](https://packagist.org/packages/joomla/cms-coding-standards)[ Docs](https://github.com/joomla/cms-coding-standards)[ RSS](/packages/joomla-cms-coding-standards/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

The Joomla project has migrated all its code to use PSR-12 codestyle instead of a custom version. If you are using this codestyle, you should also migrate to PSR-12. This codestyle will not get any further maintenance and is therefore archived since March 2024.

cms-coding-standards
====================

[](#cms-coding-standards)

Extended Joomla Coding Standards definition for use in the Joomla CMS environment

This repository includes the [Joomla](https://developer.joomla.org) CMS coding standard definition for [PHP Codesniffer](https://github.com/squizlabs/PHP_CodeSniffer). The PHP\_CodeSniffer standard will never be 100% accurate, but should be viewed as a strong set of guidelines while writing software for Joomla.

See Joomla coding standards documentation at

If you want to contribute and improve this documentation, you can find the source files in the manual section of the master branch

Requirements
------------

[](#requirements)

- PHP 5.3+
- [PHP Codesniffer](https://github.com/squizlabs/PHP_CodeSniffer) 2.9+ or
- PHP 5.6+
- [PHP Codesniffer](https://github.com/squizlabs/PHP_CodeSniffer) 3.3.0+

Installation via Composer
-------------------------

[](#installation-via-composer)

Add `"joomla/cms-coding-standards": "~1.0"` to the require-dev block in your composer.json and then run `composer install`.

```
{
    "require-dev": {
		"joomla/cms-coding-standards": "~1.0"
	}
}
```

Alternatively, you can simply run the following from the command line:

```
composer global require squizlabs/php_codesniffer "~2.8"
composer require joomla/cms-coding-standards "~1.0"
```

Running
-------

[](#running)

You can use the installed Joomla standard like:

```
phpcs --standard=Joomla-CMS path/to/code

```

Alternatively if it isn't installed you can still reference it by path like:

```
phpcs --standard=path/to/joomla/cms-coding-standards path/to/code

```

### Selectively Applying Rules

[](#selectively-applying-rules)

#### NOTE: this should be an exact copy of the "Selectively Applying Rules" section of the main Joomla Coding Standards README and is here only for reference

[](#note-this-should-be-an-exact-copy-of-the-selectively-applying-rules-section-of-the-main-joomla-coding-standards-readme-and-is-here-only-for-reference)

For consuming packages there are some items that will typically result in creating their own project ruleset.xml, rather than just directly using the Joomla ruleset.xml. A project ruleset.xml allows the coding standard to be selectivly applied for excluding 3rd party libraries, for consideration of backwards compatability in existing projects, or for adjustments necessary for projects that do not need php 5.3 compatability (which will be removed in a future version of the Joomla Coding Standard in connection of the end of php 5.3 support in all active Joomla Projects).

For information on [selectivly applying rules read details in the PHP CodeSniffer wiki](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml#selectively-applying-rules)

#### Common Rule Set Adjustments

[](#common-rule-set-adjustments)

The most common adjustment is to exclude folders with 3rd party libraries, or where the code has yet to have coding standards applied.

```

	build/*
	tests/*

	libraries/*
	vendor/*
```

Another common adjustment is to exclude the [camelCase format requirement](http://joomla.github.io/coding-standards/?coding-standards/chapters/php.md) for "Classes, Functions, Methods, Regular Variables and Class Properties" the essentially allows for B/C with snake\_case variables which were only allowed in the context of interacting with the database.

```

```

Old Protected method names were at one time prefixed with an underscore. These Protected method names with underscores are depreceated in Joomla projects but for B\\C reasons are still in the projects. As such excluding the MethodUnderscore sniff is a common ruleset adjustment

```

```

Using example rulesets that Selectively Applying Rule
-----------------------------------------------------

[](#using-example-rulesets-that-selectively-applying-rule)

You have to tell you can tell PHPCS where the example ruleset folder is (i.e. install them in PHPCS)

```
phpcs --config-set installed_paths /path/to/joomla/coding-standards/Example-Rulesets
```

Note: the composer scripts will run when the standard is installed globally, but not when it's a dependancy. As such, you may want to run PHPCS config-set. When you run PHPCS config-set it will always overwrite the previous values. Use `--config-show` to check previous values before using `--config-set`So instead of overwriting the existing paths you should copy the existing paths revealed with `--config-show` and add each one seperated by a comma: `phpcs --config-set installed_paths [path_1],[path_2],[/path/to/joomla-coding-standards],[/path/to/joomla/coding-standards/Example-Rulesets]`

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.1% 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 ~191 days

Total

3

Last Release

2501d ago

Major Versions

1.0.0-alpha → 2.0.0-alpha2019-05-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/305a2164440014dcef9ac681c139fe5e8a1ce1d7a8c3b3cfb828497729a4c70e?d=identicon)[wilsonge](/maintainers/wilsonge)

---

Top Contributors

[![mbabker](https://avatars.githubusercontent.com/u/368545?v=4)](https://github.com/mbabker "mbabker (8 commits)")[![photodude](https://avatars.githubusercontent.com/u/10253980?v=4)](https://github.com/photodude "photodude (3 commits)")[![Hackwar](https://avatars.githubusercontent.com/u/313866?v=4)](https://github.com/Hackwar "Hackwar (1 commits)")[![wilsonge](https://avatars.githubusercontent.com/u/1986000?v=4)](https://github.com/wilsonge "wilsonge (1 commits)")[![zero-24](https://avatars.githubusercontent.com/u/2596554?v=4)](https://github.com/zero-24 "zero-24 (1 commits)")

---

Tags

joomlajoomla-cms-environmentphp-codesnifferphpcsrulesetphpcsPHP\_CodeSnifferjoomlacoding-standards

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/joomla-cms-coding-standards/health.svg)

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

###  Alternatives

[joomla/coding-standards

Joomla Coding Standards

129231.7k16](/packages/joomla-coding-standards)[phpcompatibility/php-compatibility

A set of sniffs for PHP\_CodeSniffer that checks for PHP cross-version compatibility.

2.3k74.3M1.3k](/packages/phpcompatibility-php-compatibility)[suin/phpcs-psr4-sniff

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

271.7M16](/packages/suin-phpcs-psr4-sniff)[automattic/vipwpcs

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

25510.2M145](/packages/automattic-vipwpcs)[wptrt/wpthemereview

PHP\_CodeSniffer rules (sniffs) to verify theme compliance with the rules for theme hosting on wordpress.org

217736.5k29](/packages/wptrt-wpthemereview)[phpcompatibility/phpcompatibility-all

A set of rulesets for PHP\_CodeSniffer to check for PHP cross-version compatibility issues and opportunities to modernize code in PHP projects.

1361.7k](/packages/phpcompatibility-phpcompatibility-all)

PHPackages © 2026

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