Skip to content

Commit

Permalink
Validate constructor property promotion in stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed Feb 12, 2024
1 parent 20c49f8 commit 115c60e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build/gen_stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 115c60e

Please sign in to comment.