Skip to content

bug: phpstan-codeigniter forces a model class extends CodeIgniter\Model #8

Description

@kenjis

PHP Version

8.1

PHPStan CodeIgniter Version

v1.4.2.70400

PHPStan Version

1.10.39

What happened?

 ------ ---------------------------------------------------------------------------------------------------- 
  Line   app/Controllers/ActionsController.php                                                               
 ------ ---------------------------------------------------------------------------------------------------- 
  46     Argument #1 $name ('App\\Models\\NotificationMutedModel') passed to function model does not extend  
         CodeIgniter\\Model.                                                                                 
 ------ ----------------------------------------------------------------------------------------------------

https://github.com/kenjis/forum-example/blob/37a339f050ee2c40ed452e6570cef188dc0f90a0/app/Controllers/ActionsController.php#L46
https://github.com/kenjis/forum-example/blob/37a339f050ee2c40ed452e6570cef188dc0f90a0/app/Models/NotificationMutedModel.php#L11

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 on ActionsController

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions