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

Abandoned → [codeigniter/coding-standard](/?search=codeigniter%2Fcoding-standard)ArchivedPhpcodesniffer-standard[PSR &amp; Standards](/categories/psr-standards)

codeigniter4/codeigniter4-standard
==================================

CodeIgniter 4 Standard for PHP\_CodeSniffer 3.

v1.1.1(5y ago)69431.6k↓17.5%13[1 issues](https://github.com/codeigniter4/coding-standard/issues)20MITPHP

Since Dec 12Pushed 3y ago21 watchersCompare

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

READMEChangelog (1)Dependencies (4)Versions (4)Used By (20)

Deprecated
----------

[](#deprecated)

The new [CodeIgniter Coding Standard](https://github.com/CodeIgniter/coding-standard) is officially published! This switch uses PHP CS Fixer instead of Code Sniffer and applies a lot of changes (most notably, PSR-12 compliance). Visit the repo for more information. This library will remain in place but may not be maintained and is no longer considered compliant with official CodeIgniter 4 framework styles.

CodeIgniter4-Standard
=====================

[](#codeigniter4-standard)

[CodeIgniter](https://codeigniter.com) 4 coding standard for use with [PHP\_CodeSniffer 3](https://github.com/squizlabs/PHP_CodeSniffer).

Version 1

MasterDevelop[![Build Status](https://camo.githubusercontent.com/1b0e4c3dcd785404c6057f28b82db8314534a9cb127e582777ce4773f454957a/68747470733a2f2f7472617669732d63692e6f72672f626369742d63692f436f646549676e69746572342d5374616e646172642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/bcit-ci/CodeIgniter4-Standard)[![Build Status](https://camo.githubusercontent.com/ff8370f34fb070bd50266dd4c6276ca47039b373089881366465645f65be25ff/68747470733a2f2f7472617669732d63692e6f72672f626369742d63692f436f646549676e69746572342d5374616e646172642e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/bcit-ci/CodeIgniter4-Standard)[![Coverage Status](https://camo.githubusercontent.com/287008c98c3fae967810cd95f7fc830f23b495158108a9193271889333699ef5/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f626369742d63692f436f646549676e69746572342d5374616e646172642f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/bcit-ci/CodeIgniter4-Standard?branch=master)[![Coverage Status](https://camo.githubusercontent.com/2e27732b5b7a80d6eda3364e7d152c09274beb3e7c7cc162a23ce2fadd74eb23/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f626369742d63692f436f646549676e69746572342d5374616e646172642f62616467652e7376673f6272616e63683d646576656c6f70)](https://coveralls.io/github/bcit-ci/CodeIgniter4-Standard?branch=develop)***This is currently a work in progress.***

*Requested at: [codeigniter4/CodeIgniter4#182](https://github.com/codeigniter4/CodeIgniter4/issues/182)*

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

[](#requirements)

[PHP\_CodeSniffer 3](https://github.com/squizlabs/PHP_CodeSniffer). (3.1.1 or greater).

PHP (7.1 or greater) with mbstring extension.

Install
-------

[](#install)

### Composer install

[](#composer-install)

`cd /Path/To/MyProject``composer require codeigniter4/codeigniter4-standard --dev`

Set the `phpcs standard path` and `phpcbf standard path` in your editor/plugin config to:

`/Path/To/MyProject/vendor/codeigniter4/codeigniter4-standard/CodeIgniter4/ruleset.xml`

### Download install

[](#download-install)

Download [CodeIgniter4-Standard](https://github.com/bcit-ci/CodeIgniter4-Standard/archive/v1.0.1.zip).

Set `standard ` paths to your local filesystem:

`'/Path/To/CodeIgniter4-Standard/CodeIgniter4/ruleset.xml'`

### Global install

[](#global-install)

Globally [install PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer/blob/master/README.md) with one of the various methods.

Once complete you should be able to execute `phpcs -i` on the command line.

You should see something like:-

`The installed coding standards are MySource, PEAR, PSR1, PSR2, Squiz and Zend.`

Either clone this repository...

`git clone -b master --depth 1 https://github.com/bcit-ci/CodeIgniter4-Standard.git`.

or use composer...

`composer global require codeigniter4/codeigniter4-standard`

or download.

Take note of the paths where they were installed.

Create a symbolic link to the `CodeIgniter4-Standard/CodeIgniter4` directory in `php_codesniffer/src/Standards/` eg.

`ln -s ~/Documents/Projects/CodeIgniter4-Standard/CodeIgniter4 ~/.composer/vendor/squizlabs/php_codesniffer/src/Standards/CodeIgniter4`

or copy the `CodeIgniter4-Standard/CodeIgniter4` directory to `php_codesniffer/src/Standards/`

Executing `phpcs -i` should now show CodeIgniter4 installed eg.

`The installed coding standards are CodeIgniter4, MySource, PEAR, PSR1, PSR2, Squiz and Zend.`

You should now be able to set 'CodeIgniter4' as the phpcs standard in the plugin/editor/IDE of your choice.

### Command line use

[](#command-line-use)

#### Sniffing errors &amp; warnings (reporting).

[](#sniffing-errors--warnings-reporting)

Single file...

`phpcs /Path/To/MyFile.php --standard='/Path/To/CodeIgniter4-Standard/CodeIgniter4/ruleset.xml'`

or if globally installed.

`phpcs /Path/To/MyFile.php --standard=CodeIgniter4`

Directory (recursive).

`phpcs /Path/To/MyProject --standard='/Path/To/CodeIgniter4-Standard/CodeIgniter4/ruleset.xml'`

or if globally installed.

`phpcs /Path/To/MyProject --standard=CodeIgniter4`

#### Fixing fixable errors.

[](#fixing-fixable-errors)

Single file.

`phpcbf /Path/To/MyFile.php --standard='/Path/To/CodeIgniter4-Standard/CodeIgniter4/ruleset.xml'`

or if globally installed.

`phpcbf /Path/To/MyFile.php --standard=CodeIgniter4`

Directory (recursive).

`phpcbf /Path/To/MyProject --standard='/Path/To/CodeIgniter4-Standard/CodeIgniter4/ruleset.xml'`

or if globally installed.

`phpcbf /Path/To/MyProject --standard=CodeIgniter4`

Credits
-------

[](#credits)

Thanks to Greg Sherwood, Marc McIntyre, Andy Grunwald, Thomas Ernest and Erik Torsner, for providing open source code which helped me build this standard and a big thanks to [Squiz Labs](http://www.squizlabs.com) for creating [PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer).

Thanks to [EllisLab](https://ellislab.com) for originally creating CodeIgniter and the [British Columbia Institute of Technology](https://bcit.ca/) for continuing the project. Thanks to all the developers and contibutors working on [CodeIgniter 4](https://github.com/bcit-ci/CodeIgniter4).

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity50

Moderate usage in the ecosystem

Community36

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 92.2% 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 ~1179 days

Total

2

Last Release

1901d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/65f693f45781e767ed8557b776fd775309e7a262629892b99cf38462931e9b26?d=identicon)[lonnieezell](/maintainers/lonnieezell)

![](https://www.gravatar.com/avatar/5ebe908b4fe73807ecdd9f88733342199c9991b7de800329f5b2b787c8210d62?d=identicon)[MGatner](/maintainers/MGatner)

![](https://avatars.githubusercontent.com/u/3203951?v=4)[Project lead, CodeIgniter](/maintainers/jim-parry)[@jim-parry](https://github.com/jim-parry)

---

Top Contributors

[![louisl](https://avatars.githubusercontent.com/u/1140394?v=4)](https://github.com/louisl "louisl (178 commits)")[![kenjis](https://avatars.githubusercontent.com/u/87955?v=4)](https://github.com/kenjis "kenjis (7 commits)")[![MGatner](https://avatars.githubusercontent.com/u/17572847?v=4)](https://github.com/MGatner "MGatner (3 commits)")[![lonnieezell](https://avatars.githubusercontent.com/u/51931?v=4)](https://github.com/lonnieezell "lonnieezell (2 commits)")[![jrfnl](https://avatars.githubusercontent.com/u/663378?v=4)](https://github.com/jrfnl "jrfnl (1 commits)")[![michalsn](https://avatars.githubusercontent.com/u/459185?v=4)](https://github.com/michalsn "michalsn (1 commits)")[![totoprayogo1916](https://avatars.githubusercontent.com/u/2387514?v=4)](https://github.com/totoprayogo1916 "totoprayogo1916 (1 commits)")

---

Tags

codeignitercodeigniter4codeigniter4-standardphp-codesniffer

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[league/container

A fast and intuitive dependency injection container.

86787.8M343](/packages/league-container)[stella-maris/clock

A pre-release of the proposed PSR-20 Clock-Interface

7947.5M2](/packages/stella-maris-clock)[wptrt/wpthemereview

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

217736.5k29](/packages/wptrt-wpthemereview)[inpsyde/modularity

Modular PSR-11 implementation for WordPress plugins, themes or libraries.

54383.3k3](/packages/inpsyde-modularity)[php-standard-library/phpstan-extension

PHPStan PSL extension

201.2M13](/packages/php-standard-library-phpstan-extension)[elie29/zend-phpdi-config

PSR-11 PHP-DI autowire container configurator for Laminas, Mezzio, ZF2, ZF3 and Zend Expressive applications

20238.6k7](/packages/elie29-zend-phpdi-config)

PHPackages © 2026

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