phpstan-codeigniter

CodeIgniter extensions and rules for PHPStan

MIT License

Downloads
185.1K
Stars
15
Committers
2

Bot releases are hidden (Show)

phpstan-codeigniter - v1.4.3 Latest Release

Published by paulbalandan 10 months ago

Added ➕

  • Run tests on PHP 8.3
  • Add composer.json to monitored paths
  • Add branches filter on workflows
  • chore: Add parallel-lint to lint downgraded source (#16)
  • refactor: Restructure test fixtures (#15)
  • Allow specific argument type checks for factories (#14)
  • Use native PHPDocs (#12)

Fixed 🔧

  • Move codeigniter4/framework to require
  • Fix inference of type of Model::find() to base on framework behavior (#18)
  • Fix allow class const fetch when on App namespace (#13)
  • Fix styles (#11)
phpstan-codeigniter - v1.4.2

Published by paulbalandan 12 months ago

Fixed 🔧

  • Fix phpstan baselined errors
  • Allow superglobal assign and access at root level
phpstan-codeigniter - v1.4.1

Published by paulbalandan 12 months ago

Fixed 🔧

  • Added CodeIgniter\Config\ to codeigniter.additionalConfigNamespaces parameter
  • Limit rule to package configs and models only
phpstan-codeigniter - v1.4.0

Published by paulbalandan about 1 year ago

New features 🎉

  • Disallow use of class const fetch on factories functions (i.e., 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');
phpstan-codeigniter - v1.3.0

Published by paulbalandan about 1 year ago

New features 🎉

  • Provides precise return types for CodeIgniter\Model's find(), findAll(), and first() methods.
  • Allows dynamic return type transformation of CodeIgniter\Model when asArray() or asObject() is called.

Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.2.0...v1.3.0

phpstan-codeigniter - v1.2.0

Published by paulbalandan about 1 year ago

New feature 🎉

  • Provides precise return types for fake() helper function.

Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.1.3...v1.2.0

phpstan-codeigniter - v1.1.3

Published by paulbalandan about 1 year ago

Fixes 🔧

  • fix: wrong delete for remote branch

Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.1.2...v1.1.3

phpstan-codeigniter - v1.1.2

Published by paulbalandan about 1 year ago

Fixes 🔧

  • fix: add downgrade match rector
  • fix: delete remote branch

Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.1.1...v1.1.2

phpstan-codeigniter - v1.1.1

Published by paulbalandan about 1 year ago

Fixes 🔧

  • fix: add downgrade rule for nullsafe operator

Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.1.0...v1.1.1

phpstan-codeigniter - v1.1.0

Published by paulbalandan about 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/CodeIgniter/phpstan-codeigniter/compare/v1.0.1...v1.1.0

phpstan-codeigniter - v1.0.1

Published by paulbalandan about 1 year ago

Fixes 🔧

  • Add changelog
  • Fix wrong namespace of tests
  • Add missing trailing comma
phpstan-codeigniter - v1.0.0

Published by paulbalandan about 1 year ago

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.