PHPackages                             codeigniter/phpstan-codeigniter - 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. [Framework](/categories/framework)
4. /
5. codeigniter/phpstan-codeigniter

ActivePhpstan-extension[Framework](/categories/framework)

codeigniter/phpstan-codeigniter
===============================

CodeIgniter extensions and rules for PHPStan

v2.1.0(1mo ago)22591.6k—2%2[1 issues](https://github.com/CodeIgniter/phpstan-codeigniter/issues)20MITPHPPHP ^8.2CI passing

Since Aug 27Pushed 1mo ago7 watchersCompare

[ Source](https://github.com/CodeIgniter/phpstan-codeigniter)[ Packagist](https://packagist.org/packages/codeigniter/phpstan-codeigniter)[ RSS](/packages/codeigniter-phpstan-codeigniter/feed)WikiDiscussions 2.x Synced 3w ago

READMEChangelog (10)Dependencies (24)Versions (38)Used By (20)

PHPStan CodeIgniter4 extension
==============================

[](#phpstan-codeigniter4-extension)

[![Extension Tests](https://github.com/CodeIgniter/phpstan-codeigniter/actions/workflows/test-phpunit.yml/badge.svg)](https://github.com/CodeIgniter/phpstan-codeigniter/actions/workflows/test-phpunit.yml)[![Coding Standards Check](https://github.com/CodeIgniter/phpstan-codeigniter/actions/workflows/test-coding-standards.yml/badge.svg)](https://github.com/CodeIgniter/phpstan-codeigniter/actions/workflows/test-coding-standards.yml)[![PHPStan Static Analysis](https://github.com/CodeIgniter/phpstan-codeigniter/actions/workflows/test-phpstan.yml/badge.svg)](https://github.com/CodeIgniter/phpstan-codeigniter/actions/workflows/test-phpstan.yml)

- [PHPStan](https://phpstan.org/)
- [CodeIgniter4](https://codeigniter.com/)

Description
-----------

[](#description)

This PHPStan extension provides type inference support and rules for `CodeIgniter4`.

- [Rules](docs/rules.md)
- [Type inference](docs/type-inference.md)
- [Upgrading from 1.x to 2.x](docs/upgrading.md)

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

[](#installation)

To use this extension, require it in [Composer](https://getcomposer.org/):

```
composer require --dev codeigniter/phpstan-codeigniter

```

If you also install [phpstan/extension-installer](https://github.com/phpstan/extension-installer) then you're all set!

 Manual installationIf you don't want to use `phpstan/extension-installer`, include extension.neon in your project's PHPStan config:

```
includes:
    - vendor/codeigniter/phpstan-codeigniter/extension.neon
```

Bootstrapping CodeIgniter
-------------------------

[](#bootstrapping-codeigniter)

This extension boots CodeIgniter during analysis so it can read your configuration, services, and database schema. Point PHPStan at a bootstrap file that loads the framework. CodeIgniter's own test bootstrap works out of the box:

```
parameters:
    bootstrapFiles:
        - vendor/codeigniter4/framework/system/Test/bootstrap.php
```

The Model and Entity type inference additionally materializes your schema by running your migrations against a temporary SQLite database, so the `sqlite3` PHP extension is required (it is declared in this package's `composer.json`). The schema is cached under the working directory's `tmp` folder by default. See the [type inference docs](docs/type-inference.md) for how to point it at a specific namespace.

Contributing
------------

[](#contributing)

Any contributions are welcome.

If you want to see a new rule or extension specific to CodeIgniter, please open a [feature request](https://github.com/CodeIgniter/phpstan-codeigniter/issues/new?assignees=&labels=feature+request&projects=&template=feature_request.yml). If you can contribute the code yourself, please open a pull request instead.

Before reporting any bugs, please check if the bug occurs only if using this extension with PHPStan. If the bug is reproducible in PHPStan alone, please open a bug report there instead. Thank you!

License
-------

[](#license)

PHPStan CodeIgniter is an open source library licensed under [MIT](LICENSE).

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance92

Actively maintained with recent releases

Popularity47

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 91.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 ~30 days

Recently: every ~3 days

Total

35

Last Release

25d ago

Major Versions

1.x-dev → v2.0.02026-06-15

PHP version history (3 changes)v1.0.0PHP ^8.1

v1.1.0.70400PHP ^7.4 || ^8.0

v1.6.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/808229fdb6d93fadff56999d343e4235394321e88376a73b2cf41b2192c62b34?d=identicon)[paulbalandan](/maintainers/paulbalandan)

---

Top Contributors

[![paulbalandan](https://avatars.githubusercontent.com/u/51850998?v=4)](https://github.com/paulbalandan "paulbalandan (170 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (13 commits)")[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (2 commits)")

---

Tags

codeignitercodeigniter4phpphpstan-extensionstatic-analysisPHPStandevstatic analysiscodeignitercodeigniter4

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/codeigniter-phpstan-codeigniter/health.svg)

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

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M9.2k](/packages/larastan-larastan)[rector/rector

Instant Upgrade and Automated Refactoring of any PHP code

10.4k139.2M10.1k](/packages/rector-rector)[deptrac/deptrac

Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.

3.0k8.8M207](/packages/deptrac-deptrac)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

79475.7M2.3k](/packages/phpstan-phpstan-symfony)[shipmonk/dead-code-detector

Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested.

4853.5M98](/packages/shipmonk-dead-code-detector)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

67372.8M1.5k](/packages/phpstan-phpstan-doctrine)

PHPackages © 2026

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