codeigniter/phpstan-codeigniter

CodeIgniter extensions and rules for PHPStan

Maintainers

👁 paulbalandan

Package info

github.com/CodeIgniter/phpstan-codeigniter

Forum

Type:phpstan-extension

pkg:composer/codeigniter/phpstan-codeigniter

Statistics

Installs: 574 222

Dependents: 33

Suggesters: 0

Stars: 21

Open Issues: 2

v2.1.0 2026-06-15 21:10 UTC

MIT 61b03394c735eea47618e88e94090df2f9ee60c7

  • John Paul E. Balandan, CPA <paulbalandan.woop@gmail.com>

codeigniterstatic analysisdevPHPStancodeigniter4


README

👁 Extension Tests
👁 Coding Standards Check
👁 PHPStan Static Analysis

Description

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

Installation

To use this extension, require it in Composer:

composer require --dev codeigniter/phpstan-codeigniter

If you also install phpstan/extension-installer then you're all set!

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 for how to point it at a specific namespace.

Contributing

Any contributions are welcome.

If you want to see a new rule or extension specific to CodeIgniter, please open a feature request. 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

PHPStan CodeIgniter is an open source library licensed under MIT.