Validate constructor property promotion in stubs

This commit is contained in:
Máté Kocsis 2024-02-12 22:43:34 +01:00
parent 20c49f8524
commit 115c60e0bb
No known key found for this signature in database
GPG key ID: FD055E41728BF310

View file

@ -3947,6 +3947,10 @@ function parseFunctionLike(
$numRequiredArgs = 0;
$foundVariadic = false;
foreach ($func->getParams() as $i => $param) {
if ($param->isPromoted()) {
throw new Exception("Promoted properties are not supported");
}
$varName = $param->var->name;
$preferRef = !empty($paramMeta[$varName]['prefer-ref']);
unset($paramMeta[$varName]);