Skip to content

v1.0.0

Compare
Choose a tag to compare
@paulbalandan paulbalandan released this 27 Aug 09:28
v1.0.0
2c6eebd

Initial release

This PHPStan extension provides the following features:

Type Inference

  • Provides precise return types for config() and model() functions.
  • Provides precise return types for service() and single_service() functions.

Rules

  • Checks if the string argument passed to 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.
  • Checks if the string argument passed to service() or single_service() function is a valid service name. This can be turned off by setting codeigniter.checkArgumentTypeOfServices: false in your phpstan.neon.
  • Disallows instantiating cache handlers using new and suggests using the CacheFactory class instead.
  • Disallows instantiating FrameworkException classes using new.
  • Disallows direct re-assignment or access of $_SERVER and $_GET and suggests using the Superglobals class instead.