codeigniter/phpstan-codeigniter
CodeIgniter extensions and rules for PHPStan
Maintainers
Package info
github.com/CodeIgniter/phpstan-codeigniter
Type:phpstan-extension
pkg:composer/codeigniter/phpstan-codeigniter
Requires
- php: ^8.2
- ext-sqlite3: *
- phpstan/phpstan: ^2.2
Requires (Dev)
- codeigniter/coding-standard: ^1.8
- codeigniter4/framework: ^4.7
- codeigniter4/shield: ^1.2
- friendsofphp/php-cs-fixer: ^3.92
- kubawerlos/php-cs-fixer-custom-fixers: ^3.35
- nexusphp/cs-config: ^3.27
- nexusphp/tachycardia: ^2.4
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^11.5 || ^12.5
Suggests
None
Provides
None
Conflicts
Replaces
None
MIT 61b03394c735eea47618e88e94090df2f9ee60c7
- John Paul E. Balandan, CPA <paulbalandan.woop@gmail.com>
This package is auto-updated.
Last update: 2026-06-15 21:20:48 UTC
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.
