Skip to content

ActiveRecord issues and other Yii-specific issues being picked up #1

@lukew-cogapp

Description

@lukew-cogapp

Description

Hello, we have inherited a codebase and added PHPStan to it. There are lots of very specific YIi/ActiveRecord issues being picked up that we think this PHPStan extension might fix: https://github.com/erickskrauch/phpstan-yii2, but it depends on PHPStan 2.0^.

For example, we get errors like this where CrmContact extends ActiveRecord:

 69     Access to an undefined property modules\modulename\records\CrmContact::$id.

The record doesn't explicitly have an $id parameter set, which would solve this, but there is a lot of code to cover and we're trying to focus on the important areas to resolve first.

Is there a way to either upgrade this to PHPStan 2.X so we can experiment with the Yii2 extension, or perhaps a stub you could add/suggest for us?

Steps to reproduce

  1. Include the craftcms PHPStan config
  2. Run PHPStan

Additional info

  • Craft version:4
  • PHP version: 8.2.X

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