ActiveRecord issues and other Yii-specific issues being picked up
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 12
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
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
- Include the craftcms PHPStan config
- Run PHPStan
Additional info
- Craft version:4
- PHP version: 8.2.X
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Craft PHPStan configuration and the documented PHPStan invocation, then check the requested PHPStan 2.x compatibility and the reported undefined ActiveRecord property case. Done should be defined as either a working PHPStan 2.x configuration or a documented stub-based way to address the example error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100