forked from hhvm/hack-codegen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodegenClassTestCase.codegen
More file actions
152 lines (125 loc) · 3.28 KB
/
CodegenClassTestCase.codegen
File metadata and controls
152 lines (125 loc) · 3.28 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
@generated
!@#$%codegentest:testClassDeclarationWithGenerics
class ClassWithGenerics
<
Tent as IEnt,
T,
Tstory as EntCreationStory<Tent>
> {
}
!@#$%codegentest:testConstructorWrapperFunc
function TestWrapperFunc(string $text, ?bool $hack): TestWrapperFunc {
return new TestWrapperFunc($text, $hack);
}
class TestWrapperFunc {
private string $text;
private ?bool $hack = false;
public function __construct(string $text, ?bool $hack) {
$this->text = $text;
}
}
!@#$%codegentest:testConstructorWrapperFuncDefault
/**
* Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
* tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
* quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
* consequat.
* Understood?
* Yes!
*/
function TestWrapperFunc(): TestWrapperFunc {
return new TestWrapperFunc();
}
class TestWrapperFunc {
}
!@#$%codegentest:testConstructorWrapperFuncWithExplicitParams
function TestWrapperFunc(string $text): TestWrapperFunc {
return new TestWrapperFunc($text);
}
class TestWrapperFunc extends StrangeParent {
}
!@#$%codegentest:testDemo
final class Demo {
use EntProvisionalMode;
// Generated from Whatever::Method()
use WhateverTrait;
use Useless;
const MAX_SIZE = 256;
/**
* Default name of Ent.
*/
const DEFAULT_NAME = 'MyEnt';
const PI = 3.1415;
protected string $text;
private ?int $id = 12345;
/* BEGIN MANUAL SECTION Demo_header */
// Insert additional consts and vars here
/* END MANUAL SECTION */
public function __construct(string $text) {
$this->text = $text;
}
final public function getText(): string {
return $this->text;
}
/**
* This is a 76 characters comment to test the splitting based on
* indentation.
*/
protected function genX(): Awaitable<int> {
/* BEGIN MANUAL SECTION Demo::genX */
// your code here
/* END MANUAL SECTION */
}
/* BEGIN MANUAL SECTION Demo_footer */
// Insert additional methods here
/* END MANUAL SECTION */
}
!@#$%codegentest:testDocblock
/**
* Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
* tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
* quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
* consequat.
* Understood?
* Yes!
*/
class TestDocblock {
}
!@#$%codegentest:testExtendsAndFinal
final class NothingHere extends NothingHereBase
implements
JustOneInterface {
}
!@#$%codegentest:testInterfacesAndAbstract
abstract class NothingHere
implements
INothing,
// Generated from Foo::Bar()
IMeh {
}
!@#$%codegentest:testLongClassDeclaration
class ClassWithReallyLongName
extends NowThisIsTheParentClassWithALongNameItSelf {
}
!@#$%codegentest:testLongClassDeclarationWithInterfaces
class ClassWithReallyReallyLongName
extends NowThisIsTheParentClassWithALongNameItSelf
implements
InterfaceUno,
InterfaceDos,
InterfaceTres {
}
!@#$%codegentest:testLongGeneratedFrom
class Demo {
// Generated from
// EntTestFieldGettersCodegenSchema::getFieldSpecification()['RawIntEnumCustomTest']
public function getRawIntEnumCustomTest() {
}
}
!@#$%codegentest:testMultipleInterfaces
class JKRowling
implements
IHarryPotter,
IHermioneGranger,
IRonWeasley {
}