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\BaseConfigorCodeIgniter\Model, respectively. This can be turned off by settingcodeigniter.checkArgumentTypeOfFactories: falsein 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: falsein yourphpstan.neon. - Disallows instantiating cache handlers using
newand suggests using theCacheFactoryclass instead. - Disallows instantiating
FrameworkExceptionclasses using new. - Disallows direct re-assignment or access of
$_SERVERand$_GETand suggests using theSuperglobalsclass instead.