Open DABugh opened 1 year ago
Short version: for function(string ...$vars) with PHPDoc, $vars is interpreted as string[][].
function(string ...$vars)
$vars
string[][]
Consider the function:
function FunctionWithoutPHPDoc(string ...$stringArray) { var_dump($stringArray); }
$stringArray is declared as an array of strings. The hover text correctly identifies it as such:
$stringArray
@param string[] ...$stringArray
However, adding a PHPDoc changes how Intelephense recognizes the variable type.
Press Ctrl+. and select "Add PHPDoc" to produce this code block:
Ctrl
.
/** * @param string[] $stringArray * * @return void */ function FunctionWithPHPDoc(string ...$stringArray) { var_dump($stringArray); }
(the function has been renamed in this example, obviously, but that is irrelevant to the issue)
The hover text now displays:
@param string[][] $stringArray
Short version: for
function(string ...$vars)
with PHPDoc,$vars
is interpreted asstring[][]
.Consider the function:
$stringArray
is declared as an array of strings. The hover text correctly identifies it as such:However, adding a PHPDoc changes how Intelephense recognizes the variable type.
Press
Ctrl
+.
and select "Add PHPDoc" to produce this code block:(the function has been renamed in this example, obviously, but that is irrelevant to the issue)
The hover text now displays: