Releases: CodeIgniter/phpstan-codeigniter
Releases · CodeIgniter/phpstan-codeigniter
v1.0.1
Fixes 🔧
- Add changelog
- Fix wrong namespace of tests
- Add missing trailing comma
v1.0.0
Initial release
This PHPStan extension provides the following features:
Type Inference
- Provides precise return types for
config()
andmodel()
functions. - Provides precise return types for
service()
andsingle_service()
functions.
Rules
- Checks if the string argument passed to
config()
ormodel()
function is a valid class string extendingCodeIgniter\Config\BaseConfig
orCodeIgniter\Model
, respectively. This can be turned off by settingcodeigniter.checkArgumentTypeOfFactories: false
in yourphpstan.neon
. - Checks if the string argument passed to
service()
orsingle_service()
function is a valid service name. This can be turned off by settingcodeigniter.checkArgumentTypeOfServices: false
in yourphpstan.neon
. - Disallows instantiating cache handlers using
new
and suggests using theCacheFactory
class instead. - Disallows instantiating
FrameworkException
classes using new. - Disallows direct re-assignment or access of
$_SERVER
and$_GET
and suggests using theSuperglobals
class instead.