@@ -202,14 +202,14 @@ class NamingTest extends \Facebook\HackTest\HackTest {
202
202
203
203
public async function testNamespaceResolutionDependingOnSourceType (
204
204
): Awaitable <void > {
205
- $php = " <?php namespace Foo; class MyClass extends Collection {}" ;
206
- $hack = " <?hh namespace Foo; class MyClass extends Collection {}" ;
205
+ $php = ' <?php namespace Foo; class MyClass extends Collection {}' ;
206
+ $hack = ' <?hh namespace Foo; class MyClass extends Collection {}' ;
207
207
208
208
$php_class = (await FileParser :: fromDataAsync($php ))-> getClass(
209
- " Foo\\ MyClass" ,
209
+ ' Foo\\ MyClass' ,
210
210
);
211
211
$hack_class = (await FileParser :: fromDataAsync($hack ))-> getClass(
212
- " Foo\\ MyClass" ,
212
+ ' Foo\\ MyClass' ,
213
213
);
214
214
215
215
// We used to distinguish between PHP and Hack files here, but not anymore,
@@ -226,10 +226,10 @@ class NamingTest extends \Facebook\HackTest\HackTest {
226
226
$hack = ' <?hh namespace Foo; function myfunc(): string {}' ;
227
227
228
228
$php_func = (await FileParser :: fromDataAsync($php ))-> getFunction(
229
- " Foo\\ myfunc" ,
229
+ ' Foo\\ myfunc' ,
230
230
);
231
231
$hack_func = (await FileParser :: fromDataAsync($hack ))-> getFunction(
232
- " Foo\\ myfunc" ,
232
+ ' Foo\\ myfunc' ,
233
233
);
234
234
235
235
expect ($php_func -> getReturnType()?-> getTypeName())-> toBeSame(' string' );
@@ -241,9 +241,9 @@ class NamingTest extends \Facebook\HackTest\HackTest {
241
241
" namespace Foo;\n " .
242
242
" class MyClass {\n " .
243
243
" function foo(): this { }\n " .
244
- " } " ;
244
+ ' } ' ;
245
245
$parser = await FileParser :: fromDataAsync($code );
246
- $class = $parser -> getClass(" Foo\\ MyClass" );
246
+ $class = $parser -> getClass(' Foo\\ MyClass' );
247
247
$method = $class -> getMethods()[0 ];
248
248
expect ($method -> getReturnType()?-> getTypeName())-> toBeSame(' this' );
249
249
}
@@ -253,9 +253,9 @@ class NamingTest extends \Facebook\HackTest\HackTest {
253
253
" namespace Foo;\n " .
254
254
" class MyClass<T> {\n " .
255
255
" function foo(): T { }\n " .
256
- " } " ;
256
+ ' } ' ;
257
257
$parser = await FileParser :: fromDataAsync($code );
258
- $class = $parser -> getClass(" Foo\\ MyClass" );
258
+ $class = $parser -> getClass(' Foo\\ MyClass' );
259
259
$method = $class -> getMethods()[0 ];
260
260
expect ($method -> getReturnType()?-> getTypeName())-> toBeSame(' T' );
261
261
}
@@ -266,9 +266,9 @@ class NamingTest extends \Facebook\HackTest\HackTest {
266
266
" namespace Foo;\n " .
267
267
" class MyClass<T> {\n " .
268
268
" function foo(): ?T { }\n " .
269
- " } " ;
269
+ ' } ' ;
270
270
$parser = await FileParser :: fromDataAsync($code );
271
- $class = $parser -> getClass(" Foo\\ MyClass" );
271
+ $class = $parser -> getClass(' Foo\\ MyClass' );
272
272
$method = $class -> getMethods()[0 ];
273
273
expect ($method -> getReturnType()?-> getTypeName())-> toBeSame(' T' );
274
274
expect ($method -> getReturnType()?-> isNullable())-> toBeTrue();
@@ -279,9 +279,9 @@ class NamingTest extends \Facebook\HackTest\HackTest {
279
279
" namespace Foo;\n " .
280
280
" class MyClass {\n " .
281
281
" function foo<T>(): T { }\n " .
282
- " } " ;
282
+ ' } ' ;
283
283
$parser = await FileParser :: fromDataAsync($code );
284
- $class = $parser -> getClass(" Foo\\ MyClass" );
284
+ $class = $parser -> getClass(' Foo\\ MyClass' );
285
285
$method = $class -> getMethods()[0 ];
286
286
expect ($method -> getReturnType()?-> getTypeName())-> toBeSame(' T' );
287
287
}
@@ -300,7 +300,7 @@ class NamingTest extends \Facebook\HackTest\HackTest {
300
300
" ): TClassGeneric {}\n " .
301
301
" }\n " ;
302
302
$parser = await FileParser :: fromDataAsync($code );
303
- $class = $parser -> getClass(" Foo\\ MyClass" );
303
+ $class = $parser -> getClass(' Foo\\ MyClass' );
304
304
$method = $class -> getMethods()[0 ];
305
305
expect ($method -> getReturnType()?-> getTypeName())-> toBeSame(' TClassGeneric' );
306
306
expect ($method -> getParameters()[0 ]-> getTypehint()?-> getTypeName())
@@ -312,9 +312,9 @@ class NamingTest extends \Facebook\HackTest\HackTest {
312
312
" namespace Foo;\n " .
313
313
" class MyClass {\n " .
314
314
" function foo<T>(T \$ bar): Awaitable<void> { }\n " .
315
- " } " ;
315
+ ' } ' ;
316
316
$parser = await FileParser :: fromDataAsync($code );
317
- $class = $parser -> getClass(" Foo\\ MyClass" );
317
+ $class = $parser -> getClass(' Foo\\ MyClass' );
318
318
$method = $class -> getMethods()[0 ];
319
319
expect ($method -> getParameters()[0 ]-> getTypehint()?-> getTypeName())
320
320
-> toBeSame(' T' );
0 commit comments