-
Notifications
You must be signed in to change notification settings - Fork 800
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stub-generator: Handle functions calling
func_get_args()
(#36870)
If a function or method calls `func_get_args()`, Phan treats it as if it has an implicit varargs argument at the end of its parameter list. But when we stub the function it can no longer see the `func_get_args()` call so it tries to incorrect force the declared parameter list. So let's do the same thing when generating the stubs, if there's a `func_get_args()` call (and no varargs param already) let's add one.
- Loading branch information
Showing
3 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
projects/packages/stub-generator/changelog/add-stub-generator-func_get_args
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: added | ||
|
||
Add a fake `...$func_get_args` parameter to functions/methods that call `func_get_args()`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters