in codegen/syntax/ParameterDeclaration.hack [50:134]
public static function fromJSON(
dict<arraykey, mixed> $json,
string $file,
int $initial_offset,
string $source,
string $_type_hint,
): this {
$offset = $initial_offset;
$attribute = Node::fromJSON(
($json['parameter_attribute'] ?? dict['kind' => 'missing']) as dict<_, _>,
$file,
$offset,
$source,
'OldAttributeSpecification',
);
$offset += $attribute?->getWidth() ?? 0;
$visibility = Node::fromJSON(
($json['parameter_visibility'] ?? dict['kind' => 'missing'])
as dict<_, _>,
$file,
$offset,
$source,
'Token',
);
$offset += $visibility?->getWidth() ?? 0;
$call_convention = Node::fromJSON(
($json['parameter_call_convention'] ?? dict['kind' => 'missing'])
as dict<_, _>,
$file,
$offset,
$source,
'InoutToken',
);
$offset += $call_convention?->getWidth() ?? 0;
$readonly = Node::fromJSON(
($json['parameter_readonly'] ?? dict['kind' => 'missing']) as dict<_, _>,
$file,
$offset,
$source,
'ReadonlyToken',
);
$offset += $readonly?->getWidth() ?? 0;
$type = Node::fromJSON(
($json['parameter_type'] ?? dict['kind' => 'missing']) as dict<_, _>,
$file,
$offset,
$source,
'ITypeSpecifier',
);
$offset += $type?->getWidth() ?? 0;
$name = Node::fromJSON(
($json['parameter_name']) as dict<_, _>,
$file,
$offset,
$source,
'IExpression',
);
$name = $name as nonnull;
$offset += $name->getWidth();
$default_value = Node::fromJSON(
($json['parameter_default_value'] ?? dict['kind' => 'missing'])
as dict<_, _>,
$file,
$offset,
$source,
'SimpleInitializer',
);
$offset += $default_value?->getWidth() ?? 0;
$source_ref = shape(
'file' => $file,
'source' => $source,
'offset' => $initial_offset,
'width' => $offset - $initial_offset,
);
return new static(
/* HH_IGNORE_ERROR[4110] */ $attribute,
/* HH_IGNORE_ERROR[4110] */ $visibility,
/* HH_IGNORE_ERROR[4110] */ $call_convention,
/* HH_IGNORE_ERROR[4110] */ $readonly,
/* HH_IGNORE_ERROR[4110] */ $type,
/* HH_IGNORE_ERROR[4110] */ $name,
/* HH_IGNORE_ERROR[4110] */ $default_value,
$source_ref,
);
}