PHPackages                             mediawiki/mediawiki-codesniffer - 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. mediawiki/mediawiki-codesniffer

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

mediawiki/mediawiki-codesniffer
===============================

MediaWiki CodeSniffer Standards

v50.0.0(3mo ago)332.9M↑13.7%1220GPL-2.0-or-laterPHPPHP &gt;=8.2.0

Since Jan 5Pushed 1mo ago10 watchersCompare

[ Source](https://github.com/wikimedia/mediawiki-tools-codesniffer)[ Packagist](https://packagist.org/packages/mediawiki/mediawiki-codesniffer)[ Docs](https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP)[ RSS](/packages/mediawiki-mediawiki-codesniffer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (9)Versions (67)Used By (20)

MediaWiki coding conventions
============================

[](#mediawiki-coding-conventions)

Abstract
--------

[](#abstract)

This project implements a set of rules for use with [PHP CodeSniffer](https://packagist.org/packages/squizlabs/php_codesniffer).

See [MediaWiki conventions](https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP) on our wiki for a detailed description of the coding conventions that are validated by these rules. :-)

How to install
--------------

[](#how-to-install)

1. Create a composer.json which adds this project as a dependency. The latest version number can be found in [HISTORY.md](HISTORY.md) or on [Packagist](https://packagist.org/packages/mediawiki/mediawiki-codesniffer).

    ```
    {
    	"require-dev": {
    		"mediawiki/mediawiki-codesniffer": "48.0.0"
    	},
    	"scripts": {
    		"test": [
    			"phpcs -p -s"
    		],
    		"fix": "phpcbf"
    	}
    }

    ```
2. Create a .phpcs.xml with our configuration:

    ```

    	.

    ```
3. Install: `composer update`
4. Run: `composer test`
5. Run: `composer fix` to auto-fix some of the errors, others might need manual intervention.
6. Commit!

Note that for most MediaWiki projects, we'd also recommend adding a PHP linter to your `composer.json` – see the [full documentation](https://www.mediawiki.org/wiki/Continuous_integration/Entry_points#PHP) for more details.

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

[](#configuration)

Some of the sniffs provided by this codesniffer standard allow you to configure details of how they work.

- `MediaWiki.Classes.FullQualifiedClassName`: This sniff is disabled by default.

    ```

        5

    ```
- `MediaWiki.Usage.ExtendClassUsage`: This sniff lets you exclude globals from being reported by the sniff, in case they cannot be replaced with a Config::getConfig() call. Examples that are already in the list include `$wgTitle` and `$wgUser`.

    ```

    ```
- `MediaWiki.Commenting.ClassLevelLicense`: This sniff does nothing by default.

    ```

    ```
- `MediaWiki.NamingConventions.PrefixedGlobalFunctions`: This sniff lets you define a list of ignored global functions and a list of allowed prefixes. By default the only allowed prefix is 'wf', corresponding to the global function `wf...()`.

    ```

    ```
- `MediaWiki.NamingConventions.ValidGlobalName`: This sniff lets you define a list of ignored globals and a list of allowed prefixes. By default the only allowed prefix is 'wg', for global variables `$wg...`.

    ```

    ```
- `MediaWiki.Arrays.TrailingComma`: This sniff lets you enforce that multi-line arrays have trailing commas, which makes Git diffs nicer. It can also enforce that single-line arrays have no trailing comma. By default, it does nothing.

    ```

    ```

---

###  Health Score

72

—

ExcellentBetter than 100% of packages

Maintenance87

Actively maintained with recent releases

Popularity53

Moderate usage in the ecosystem

Community51

Growing community involvement

Maturity90

Battle-tested with a long release history

 Bus Factor3

3 contributors hold 50%+ of commits

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 ~62 days

Recently: every ~94 days

Total

66

Last Release

98d ago

Major Versions

v45.0.0 → v46.0.02025-01-27

v46.0.0 → v47.0.02025-05-04

v47.0.0 → v48.0.02025-09-04

v48.0.0 → v49.0.02026-01-11

v49.0.0 → v50.0.02026-02-10

PHP version history (7 changes)v0.6.0PHP &gt;= 5.5.9

v20.0.0PHP &gt;= 5.6.99

v28.0.0PHP &gt;= 7.2.0

v30.0.0PHP &gt;=7.2.0

v40.0.0PHP &gt;=7.4.0

v48.0.0PHP &gt;=8.1.0

v49.0.0PHP &gt;=8.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b94d9718c06ec7c3fd7a104bc44966fb7464b9ec7411582343ea35a7a6a85f08?d=identicon)[mediawiki](/maintainers/mediawiki)

![](https://www.gravatar.com/avatar/716c86d71cbf921e7912a505f89d799de398fc0a3af0bd4c8862834b2d642bd7?d=identicon)[wikimedia](/maintainers/wikimedia)

![](https://www.gravatar.com/avatar/04ec0961d2ae0857d9f5c07f8869890e5651966b2981eb18e51ee292767dd3d7?d=identicon)[hashar](/maintainers/hashar)

![](https://www.gravatar.com/avatar/f281fc1a5701e1e7002129e0198e12bff5c8ce049377bf1f75b022d588a5bd94?d=identicon)[legoktm](/maintainers/legoktm)

---

Top Contributors

[![umherirrender](https://avatars.githubusercontent.com/u/1174884?v=4)](https://github.com/umherirrender "umherirrender (275 commits)")[![legoktm](https://avatars.githubusercontent.com/u/81392?v=4)](https://github.com/legoktm "legoktm (139 commits)")[![thiemowmde](https://avatars.githubusercontent.com/u/6576639?v=4)](https://github.com/thiemowmde "thiemowmde (118 commits)")[![DannyS712](https://avatars.githubusercontent.com/u/46829944?v=4)](https://github.com/DannyS712 "DannyS712 (65 commits)")[![Daimona](https://avatars.githubusercontent.com/u/38216014?v=4)](https://github.com/Daimona "Daimona (64 commits)")[![jdforrester](https://avatars.githubusercontent.com/u/881572?v=4)](https://github.com/jdforrester "jdforrester (45 commits)")[![reedy](https://avatars.githubusercontent.com/u/67615?v=4)](https://github.com/reedy "reedy (31 commits)")[![hashar](https://avatars.githubusercontent.com/u/281689?v=4)](https://github.com/hashar "hashar (29 commits)")[![paladox](https://avatars.githubusercontent.com/u/5727000?v=4)](https://github.com/paladox "paladox (16 commits)")[![ZabeMath](https://avatars.githubusercontent.com/u/35405030?v=4)](https://github.com/ZabeMath "ZabeMath (15 commits)")[![polybuildr](https://avatars.githubusercontent.com/u/6189009?v=4)](https://github.com/polybuildr "polybuildr (14 commits)")[![addshore](https://avatars.githubusercontent.com/u/3308769?v=4)](https://github.com/addshore "addshore (12 commits)")[![MaxSem](https://avatars.githubusercontent.com/u/1260606?v=4)](https://github.com/MaxSem "MaxSem (10 commits)")[![lucaswerkmeister](https://avatars.githubusercontent.com/u/2346599?v=4)](https://github.com/lucaswerkmeister "lucaswerkmeister (9 commits)")[![tgr](https://avatars.githubusercontent.com/u/145412?v=4)](https://github.com/tgr "tgr (9 commits)")[![mainframe98](https://avatars.githubusercontent.com/u/14977407?v=4)](https://github.com/mainframe98 "mainframe98 (8 commits)")[![samwilson](https://avatars.githubusercontent.com/u/213655?v=4)](https://github.com/samwilson "samwilson (5 commits)")[![Krinkle](https://avatars.githubusercontent.com/u/156867?v=4)](https://github.com/Krinkle "Krinkle (5 commits)")[![ricordisamoa](https://avatars.githubusercontent.com/u/4588496?v=4)](https://github.com/ricordisamoa "ricordisamoa (4 commits)")[![TasneemLo](https://avatars.githubusercontent.com/u/14144964?v=4)](https://github.com/TasneemLo "TasneemLo (4 commits)")

---

Tags

mediawikicodesniffer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mediawiki-mediawiki-codesniffer/health.svg)

```
[![Health](https://phpackages.com/badges/mediawiki-mediawiki-codesniffer/health.svg)](https://phpackages.com/packages/mediawiki-mediawiki-codesniffer)
```

###  Alternatives

[mediawiki/chameleon-skin

A highly flexible MediaWiki skin using Bootstrap 4

12481.8k2](/packages/mediawiki-chameleon-skin)[mediawiki/maps

Adds various mapping features to MediaWiki

84145.0k3](/packages/mediawiki-maps)[mediawiki/semantic-extra-special-properties

Provides extra special properties for Semantic MediaWiki

3074.6k1](/packages/mediawiki-semantic-extra-special-properties)[mediawiki/semantic-scribunto

A Semantic Mediawiki extension to natively support the Scribunto extension

2967.5k](/packages/mediawiki-semantic-scribunto)[professional-wiki/network

MediaWiki extension for adding interactive network visualizations to your wiki pages

3211.9k](/packages/professional-wiki-network)[professional-wiki/modern-timeline

Adds a modern timeline visualization as Semantic MediaWiki result format

1820.8k1](/packages/professional-wiki-modern-timeline)

PHPackages © 2026

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