"Parameter type 'Array' is invalid" in Refactor->Change signature... in PhpStorm; can't refactor function signature
Using PhpStorm 8.0.3 on Windows 7 Professional 64-bit.
Refactoring some legacy code with parameter type hinting for array parameters.
e.g.
function myFunction(Array $someArray, $anotherParam)
{
...
}
Right-click on function name, select Refactor->Change Signature...
The dialog has a warning/error message at the bottom
"Parameter type 'Array' is invalid"
Then when I reorder the parameters and click 'Refactor' it won't complete the refactoring, instead it gives an error popup
"Parameter type 'Array' is invalid" So I can't reorder the parameters without temporarily removing the Array type hinting.
Please sign in to leave a comment.
Hi there,
I may only suggest changing "Array" to "array" -- works fine this way.
Other than that -- feel free to submit new ticket to the Issue Tracker
Thanks for the suggestion, much appreciated :-)
Unfortunately we have a lot of legacy code & it would be really helpful if Array was accepted (which is valid PHP AFAIK).
I'll look at raising an issue as you suggest.
Regards
Alan