NewYour coding agent can read the release notes before it upgrades.Set up the MCP server β
Packagist
Packagist, #3352 most downloaded on Packagist
CodeIgniter extensions and rules for PHPStan
Latest stable
v2.2.3
Last release 13 days ago
09 Nov 2026
Release timing varies
gaps range from 9 days to 12 months
Most releases are documented
notes for 25 of 36 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
36 releases Β· first in 2023
Drag across the ruler to compare, or tap a release to open it.
Fix SuperglobalsOffsetAccessRule auto-fixes that would cause a PHP fatal error: isset() on a superglobal offset is now rewritten to !== null, and no f
SuperglobalsOffsetAccessRule auto-fixes that would cause a PHP fatal error: isset() on a superglobal offset is now rewritten to !== null, and no fix is applied for multi-variable isset(), compound assignment, increment or decrement.Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v2.2.2...v2.2.3
Superglobals access (reads) are now suggested to use single_service() for live fetches. Auto-fixing now also considers variable context so that a fix
single_service() for live fetches. Auto-fixing now also considers variable context so that a fix would not crash PHP.Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v2.2.1...v2.2.2
Your coding agent can read these notes before it upgrades. Set up the MCP server β
Extensions are now natively supporting PHPStan's extension attributes. Requires PHPStan v2.3.5
Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v2.2.0...v2.2.1
Static `Factories` loaders. Factories::config(), Factories::models() and Factories::get() now return the requested class, the same as the config() and
Factories loaders. Factories::config(), Factories::models() and Factories::get() now return the requested class, the same as the config() and model() functions. A class-string resolves for any component. A short alias such as Factories::config('App') resolves through the config and model namespaces, including additionalConfigNamespaces and additionalModelNamespaces.Request::getServer(). With no index it returns array<string, mixed>. A constant key returns string|null, or the actual type for argv, argc, REQUEST_TIME and REQUEST_TIME_FLOAT.IncomingRequest input accessors. getGet(), getPost(), getCookie(), getPostGet(), getGetPost() and getRawInputVar() return array<string, mixed> for a null or array index. A constant string index returns array<mixed>|string|null (getRawInputVar() keeps its declared type here). A filter argument also keeps the declared type.assert(count($classTypes) === 1) on model fetch chains such as $this->select('name')->asArray()->find(). When the receiver has no known class, the model fetch extension now falls back to the declared return type.find(), findAll(), first() and findColumn() called on a union of models, for example ($flag ? $users : $jobs)->find(1), now return the union of the row types of every model in it. Previously they used the first model's type only.CodeIgniter 4.7.5 will declare precise types for the ResultInterface row accessors, the CLIRequest input getters, current_url()/previous_url(), and IncomingRequest::getJSON()/getJsonVar() (codeigniter4/CodeIgniter4#10588). This extension doesn't add those types itself. Upgrade CodeIgniter when 4.7.5 is out to get them.
Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v2.1.0...v2.2.0
Type asObject-fetched entities by the producing model's casts
Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v2.0.1...v2.1.0
Apply the model's casts to entity property types
Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v2.0.0...v2.0.1
> This is a major release with breaking changes. Read the Upgrade Guide before upgrading.
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.
^8.2^2.2^4.7sqlite3 PHP extension (new, powers the schema layer)Resolved from your live schema instead of heuristics (closes #17, #19, #25):
Model::find(), findAll(), first(), and findColumn() return the precise row type for the model's $returnType (an entity, a shaped array{...} of columns, or a stdClass), honoring asArray(), asObject(), and the select() field list (aliases, table.*, and joined columns).$casts and $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.
SuperglobalsOffsetAccess, SuperglobalsOffsetAssign, SuperglobalsOffsetUnset, SuperglobalsGlobalAssign), now also catching whole-array assignment. Most are auto-fixable with vendor/bin/phpstan analyse --fix.config() / model() ::class discouragement rule was removed.^2.2 and the sqlite3 extension are now required.See the Upgrade Guide for the full migration steps.
Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.6.0...v2.0.0
Bump actions/checkout from 4 to 5
list syntax in phpdocutil_bootstrapFull Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.5.4...v1.6.0
Fix deprecated call to ClassReflection::isSubclassOf()
ClassReflection::isSubclassOf()ReflectionHelperGetPrivateMethodInvokerReturnTypeExtension (#35)Services::getSharedInstance()CacheFactoryGetHandlerReturnTypeExtension (#37)REQUEST_TIME and REQUEST_TIME_FLOAT as allowed offsetsFull Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.5.3...v1.5.4
Remove conflict in composer.json by @samsonasik in https://github.com/CodeIgniter/phpstan-codeigniter/pull/34
Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.5.2...v1.5.3
Move codeigniter4/framework to require-dev
codeigniter4/framework to require-dev (#33)Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.5.1...v1.5.2
Remove downgrade hacks as CI4 requires PHP 8.1
Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.5.0...v1.5.1
Fix deprecation of ParametersAcceptorSelector::selectSingle()
deleted_at on UserModelParametersAcceptorSelector::selectSingle()Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.4.3...v1.5.0
Add composer.json to monitored paths
composer.json to monitored pathsparallel-lint to lint downgraded source (#16)codeigniter4/framework to requireModel::find() to base on framework behavior (#18)App namespace (#13)Allow superglobal assign and access at root level
Added CodeIgniter\Config\ to codeigniter.additionalConfigNamespaces parameter
CodeIgniter\Config\ to codeigniter.additionalConfigNamespaces parameterDisallow use of class const fetch on factories functions (i.e., config() and model()) and instead suggests use the short form call. ```php use Config\
config() and model()) and instead suggests use the short form call.use Config\App;
// This call:
config (App::class);
// is suggested to be changed to
config('App');
Provides precise return types for CodeIgniter\Model's find(), findAll(), and first() methods.
CodeIgniter\Model's find(), findAll(), and first() methods.CodeIgniter\Model when asArray() or asObject() is called.Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.2.0...v1.3.0
Provides precise return types for fake() helper function.
fake() helper function.Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.1.3...v1.2.0
fix: wrong delete for remote branch
Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.1.2...v1.1.3
fix: add downgrade match rector
Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.1.1...v1.1.2
fix: add downgrade rule for nullsafe operator
Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.1.0...v1.1.1
Bump actions/checkout from 3 to 4 by @dependabot in https://github.com/CodeIgniter/phpstan-codeigniter/pull/4
Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.0.1...v1.1.0
### Fixes π§ * Add changelog * Fix wrong namespace of tests * Add missing trailing comma
This PHPStan extension provides the following features:
This PHPStan extension provides the following features:
config() and model() functions.service() and single_service() functions.config() or model() function is a valid class string extending CodeIgniter\Config\BaseConfig or CodeIgniter\Model, respectively. This can be turned off by setting codeigniter.checkArgumentTypeOfFactories: false in your phpstan.neon.service() or single_service() function is a valid service name. This can be turned off by setting codeigniter.checkArgumentTypeOfServices: false in your phpstan.neon.new and suggests using the CacheFactory class instead.FrameworkException classes using new.$_SERVER and $_GET and suggests using the Superglobals class instead.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.