class MyClass {
protected function groupBy(string $key, array $data)
{
$result = [];
foreach ($data as $dataItem) {
if (array_key_exists($key, $dataItem)) {
$result[$dataItem[$key]][] = $dataItem;
} else {
$result[""][] = $dataItem;
}
}
return $result;
}
}
Try to right-click hover selected $key
argument and "Rename symbol" does trigger the following error:

This is the error received in the Output tab:
PHP Tools server started.
PID: 93622
Processing files: .php; .phtml
[Error - 1:00:08 PM] Request textDocument/rename failed.
Message: Refactoring does not support this location.
Code: 101
[Error - 1:00:23 PM] Request textDocument/rename failed.
Message: Refactoring does not support this location.
Code: 101