Skip to content

Releases: CodeIgniter/phpstan-codeigniter

v1.0.1

30 Aug 06:37
v1.0.1
de64b5e
Compare
Choose a tag to compare

Fixes 🔧

  • Add changelog
  • Fix wrong namespace of tests
  • Add missing trailing comma

v1.0.0

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

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.