PhanRedefineFunctionInternal while testing with `function_exists`
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 5.6k
- Forks
- 365
- Avg merge
- 1h 25m
- Merged PRs (30d)
- 6
Description
Phan 3.0.3
PhanRedefineFunctionInternal Function curl_file_create defined at tests/testfunctionexists.txt:3 was previously defined internally
The test !function_exists(...) should avoid this warning.
if (!function_exists('curl_file_create')) {
function curl_file_create($filename, $mimetype = '', $postname = '') {
return "@$filename;filename="
. ($postname ?: basename($filename))
. ($mimetype ? ";type=$mimetype" : '');
}
}
https://github.com/phan/phan/blob/f638db25e0c0830f7f93e9ed538a30030c7332ec/src/Phan/Plugin/Internal/CallableParamPlugin.php#L176 seems to handle a similar exception
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 reproduction in tests/testfunctionexists.txt and inspect the similar exception handling at src/Phan/Plugin/Internal/CallableParamPlugin.php:176. Reproduce the function_exists guard, then trace the internal-function redefinition warning and confirm that the warning is no longer reported for this pattern.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100