forked from hhvm/hhast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Script.php
78 lines (68 loc) · 1.88 KB
/
Script.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?hh // strict
/**
* This file is generated. Do not modify it manually!
*
* @generated SignedSource<<ce298b2e52adef7e96da6934c9f22805>>
*/
namespace Facebook\HHAST;
use namespace Facebook\TypeAssert;
final class Script extends EditableNode {
private EditableNode $_declarations;
public function __construct(EditableNode $declarations) {
parent::__construct('script');
$this->_declarations = $declarations;
}
<<__Override>>
public static function fromJSON(
dict<string, mixed> $json,
string $file,
int $offset,
string $source,
): this {
$declarations = EditableNode::fromJSON(
/* UNSAFE_EXPR */ $json['script_declarations'],
$file,
$offset,
$source,
);
$offset += $declarations->getWidth();
return new self($declarations);
}
<<__Override>>
public function getChildren(): KeyedTraversable<string, EditableNode> {
return dict[
'declarations' => $this->_declarations,
];
}
<<__Override>>
public function rewriteDescendants(
self::TRewriter $rewriter,
?Traversable<EditableNode> $parents = null,
): this {
$parents = $parents === null ? vec[] : vec($parents);
$parents[] = $this;
$declarations = $this->_declarations->rewrite($rewriter, $parents);
if ($declarations === $this->_declarations) {
return $this;
}
return new self($declarations);
}
public function getDeclarationsUNTYPED(): EditableNode {
return $this->_declarations;
}
public function withDeclarations(EditableNode $value): this {
if ($value === $this->_declarations) {
return $this;
}
return new self($value);
}
public function hasDeclarations(): bool {
return !$this->_declarations->isMissing();
}
/**
* @returns EditableList
*/
public function getDeclarations(): EditableList {
return TypeAssert\instance_of(EditableList::class, $this->_declarations);
}
}