codeigniter/phpstan-codeigniter
CodeIgniter extensions and rules for PHPStan
v2.1.0
662K downloads/mo
#4669 most downloaded on Packagist
CodeIgniter/phpstan-codeigniter
What this package is like to depend on
Last release 2 months ago
15 Jun 2026
Release timing varies
gaps range from 9 days to 12 months
Some releases are documented
notes for 9 of 32 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
32 releases · first in 2023
4 releases in the last 12 months
see the full history below
Release timeline
32 releases · Aug 2023 to Jun 2026Releases
latest 32-
v2.1.015 Jun 2026Release notes
Open source →What's Changed
Added
- Type asObject-fetched entities by the producing model's casts
Full Changelog: v2.0.1...v2.1.0
-
v2.0.115 Jun 2026Release notes
Open source →What's Changed
Fixed
- Apply the model's casts to entity property types
Full Changelog: v2.0.0...v2.0.1
-
v2.0.015 Jun 2026Release notes
Open source →Highlights
This release is a ground-up rewrite of the extension. The headline feature is Model and Entity type inference driven by your real database schema: the extension materializes your schema by running your migrations against a temporary SQLite database, then uses it to type your models, entities, and fetched rows.
Important
This is a major release with breaking changes. Read the Upgrade Guide before upgrading.
Requirements
- PHP
^8.2 - PHPStan
^2.2 - CodeIgniter 4
^4.7 - The
sqlite3PHP extension (new, powers the schema layer)
What's new
Model and Entity type inference
Resolved from your live schema instead of heuristics (closes #17, #19, #25):
Model::find(),findAll(),first(), andfindColumn()return the precise row type for the model's$returnType(an entity, a shapedarray{...}of columns, or astdClass), honoringasArray(),asObject(), and theselect()field list (aliases,table.*, and joined columns).- Entity virtual properties are typed from the entity's
$castsand$dates(including custom$castHandlers) layered over the backing database column. fake()returns a single fabricated record of the model's return type.
See the type inference docs for the full list.
Rules
- The superglobals rules were split into four (
SuperglobalsOffsetAccess,SuperglobalsOffsetAssign,SuperglobalsOffsetUnset,SuperglobalsGlobalAssign), now also catching whole-array assignment. Most are auto-fixable withvendor/bin/phpstan analyse --fix. - The
config()/model()::classdiscouragement rule was removed.
Breaking changes
- PHPStan
^2.2and thesqlite3extension are now required. - Rule identifiers and messages changed (the superglobals split/rename and the removed discouragement rule), so existing baseline entries will no longer match and must be regenerated.
See the Upgrade Guide for the full migration steps.
Full Changelog: v1.6.0...v2.0.0
- PHP
-
v1.6.015 Jun 2026Release notes
Open source →What's Changed
- Use
listsyntax in phpdoc - Do not use deprecated fixer
- Use
util_bootstrap - Bump actions/checkout from 4 to 5 (#39)
- Simplify test code
- Rename phpstan.dist.neon
- Fix list type required for ConstantArrayType key
- Security harden workflows
- Bump actions/cache from 5.0.4 to 5.0.5 (#42)
- Report abandoned packages
- Bump shivammathur/setup-php from 2.37.0 to 2.37.1 (#43)
- Bump actions/checkout from 6.0.2 to 6.0.3 (#44)
- Bump shivammathur/setup-php from 2.37.1 to 2.37.2 (#45)
- Drop support for PHP 8.1
Full Changelog: v1.5.4...v1.6.0
- Use
-
v1.5.424 Jun 2025Release notes
Open source →What's Changed
- Fix deprecated call to
ClassReflection::isSubclassOf() - Remove unneeded PHPDoc on rules
- Add
ReflectionHelperGetPrivateMethodInvokerReturnTypeExtension(#35) - Fix calling non-static method without an object
- Add extension for
Services::getSharedInstance() - Extract type inference to separate doc
- Fix outdated info in README
- Fix code style and tests
- Add
CacheFactoryGetHandlerReturnTypeExtension(#37) - Allow certain superglobal offsets to be set directly
- Add
REQUEST_TIMEandREQUEST_TIME_FLOATas allowed offsets
Full Changelog: v1.5.3...v1.5.4
- Fix deprecated call to
-
v1.5.324 Jan 2025Release notes
Open source → -
v1.5.224 Jan 2025Release notes
Open source →Fixed 🔧
- Move
codeigniter4/frameworkto require-dev (#33) - Fix code styles
New Contributors
- @samsonasik made their first contribution in #33
Full Changelog: v1.5.1...v1.5.2
- Move
-
v1.5.102 Dec 2024Release notes
Open source → -
v1.5.002 Dec 2024Release notes
Open source →What's Changed
- Fix removed
deleted_aton UserModel - Move bootstrap.php to root
- Apply cs fixes
- Update rector/rector requirement from ^0.18.2 to ^0.19.2 (#23)
- Bump actions/cache from 3 to 4 (#22)
- Update rector/rector requirement from ^0.19.2 to ^1.0.0 (#24)
- Fix styles
- Add explicit callback for array_filter
- Fix return type of locator service
- Fix return PHPDocs
- Fix deprecation of
ParametersAcceptorSelector::selectSingle() - Update phpunit/phpunit requirement from ^10.2 to ^11.4 (#29)
- Bump to phpstan 2.0
Full Changelog: v1.4.3...v1.5.0
- Fix removed
-
v1.4.321 Dec 2023Nothing published for this version
-
v1.4.205 Nov 2023Nothing published for this version
-
v1.4.121 Oct 2023Nothing published for this version
-
v1.4.012 Oct 2023Nothing published for this version
-
v1.3.018 Sep 2023Nothing published for this version
-
v1.2.016 Sep 2023Nothing published for this version
-
v1.1.311 Sep 2023Nothing published for this version
-
v1.1.211 Sep 2023Nothing published for this version
-
v1.1.111 Sep 2023Nothing published for this version
-
v1.1.011 Sep 2023Nothing published for this version
-
v1.0.130 Aug 2023Nothing published for this version
-
v1.0.027 Aug 2023Nothing published for this version
-
v1.5.0.7040002 Dec 2024Nothing published for this version
-
v1.4.3.7040021 Dec 2023Nothing published for this version
-
v1.4.2.7040005 Nov 2023Nothing published for this version
-
v1.4.1.7040021 Oct 2023Nothing published for this version
-
v1.4.0.7040012 Oct 2023Nothing published for this version
-
v1.3.0.7040018 Sep 2023Nothing published for this version
-
v1.2.0.7040016 Sep 2023Nothing published for this version
-
v1.1.3.7040011 Sep 2023Nothing published for this version
-
v1.1.2.7040011 Sep 2023Nothing published for this version
-
v1.1.1.7040011 Sep 2023Nothing published for this version
-
v1.1.0.7040011 Sep 2023Nothing published for this version