mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
gen_stub: convert parseFramelessFunctionInfo()
to a constructor
Also mark `FramelessFunctionInfo::$arity` readonly
This commit is contained in:
parent
9da6050e08
commit
4af64fdbfa
1 changed files with 8 additions and 9 deletions
|
@ -4238,15 +4238,14 @@ function parseDocComment(DocComment $comment): array {
|
|||
}
|
||||
|
||||
class FramelessFunctionInfo {
|
||||
public int $arity;
|
||||
}
|
||||
public /* readonly */ int $arity;
|
||||
|
||||
function parseFramelessFunctionInfo(string $json): FramelessFunctionInfo {
|
||||
// FIXME: Should have some validation
|
||||
$json = json_decode($json, true);
|
||||
$framelessFunctionInfo = new FramelessFunctionInfo();
|
||||
$framelessFunctionInfo->arity = $json["arity"];
|
||||
return $framelessFunctionInfo;
|
||||
public function __construct(string $json) {
|
||||
// FIXME: Should have some validation
|
||||
$json = json_decode($json, true);
|
||||
|
||||
$this->arity = $json["arity"];
|
||||
}
|
||||
}
|
||||
|
||||
function parseFunctionLike(
|
||||
|
@ -4330,7 +4329,7 @@ function parseFunctionLike(
|
|||
break;
|
||||
|
||||
case 'frameless-function':
|
||||
$framelessFunctionInfos[] = parseFramelessFunctionInfo($tag->getValue());
|
||||
$framelessFunctionInfos[] = new FramelessFunctionInfo($tag->getValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue