Check for inheritance issues when analyzing php 8.2 readonly classes
Open
Nobody has claimed this yet.
enhancement
php8.2
- Dominant language
- PHP
- Stars
- 5.6k
- Forks
- 365
- Avg merge
- 1h 25m
- Merged PRs (30d)
- 6
Description
Phan should warn about invalid inheritance for https://wiki.php.net/rfc/readonly_classes
Related to #4684
php > readonly class B {}
php > class C extends B{}
Fatal error: Non-readonly class C cannot extend readonly class B in php shell code on line 1
php > readonly class D extends stdClass{}
Fatal error: Readonly class D cannot extend non-readonly class stdClass in php shell code on line 1
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
The issue names no source file, test, or entry point. Reproduce the two PHP 8.2 inheritance examples, then trace Phan's class-inheritance analysis to determine where readonly compatibility is checked; done when both invalid combinations produce appropriate warnings without false positives.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100