Add `@phan-real-param` annotation option?
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 5.6k
- Forks
- 365
- Avg merge
- 1h 25m
- Merged PRs (30d)
- 6
Description
When that annotation is used, pretend it is the real signature type for analysis purposes. Warn if they are incompatible or about not being fully supported if they overridden by other methods
This can be used to generate stubs with the equivalent of union types, or newer features, or resource.
(e.g. to prepare for upgrading an extension or php version, in combination with internal stubs)
This may be useful for tooling that removes syntax incompatible with older php versions.
Phan already supports @phan-real-return
/** @phan-real-param array|int $x */
function test($x) {
}
test('test'); // Should emit stricter real type mismatch warning
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 by locating Phan's existing @phan-real-return support and tracing how annotations affect signature analysis. Define the behavior for @phan-real-param, including incompatible calls and overrides, then add coverage for the union-type example and verify the intended warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100