Skip to content

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

Closed
@kenjis

Description

@kenjis

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions