CodeIgniter / phpstan-codeigniter

CodeIgniter extensions and rules for PHPStan
https://codeigniter.com/
MIT License
15 stars 0 forks source link

bug: invalid "Call to function model with *::class is discouraged." #9

Closed kenjis closed 10 months ago

kenjis commented 10 months ago

PHP Version

8.1

PHPStan CodeIgniter Version

v1.4.2.70400

PHPStan Version

1.10.39

What happened?

The following error is invalid. In App namespace, if we want to point the class exactly, we should be able to do it.

 ------ -------------------------------------------------------------------------------------------- 
  Line   app/Controllers/Account/SecurityController.php                                              
 ------ -------------------------------------------------------------------------------------------- 
  29     Call to function model with CodeIgniter\Shield\Models\RememberModel::class is discouraged.  
         💡 Use model('RememberModel') instead to allow overriding.                                  
 ------ -------------------------------------------------------------------------------------------- 

Minimum Reproduction Script

git clone https://github.com/kenjis/forum-example --branch=add-phpstan-codeigniter
cd forum-example/
composer install
vendor/bin/phpstan

Expected Output

No error.