1
- <?php declare (strict_types=1 );
1
+ <?php
2
+
3
+ declare (strict_types=1 );
2
4
3
5
namespace TolerantASTConverter \Tests ;
4
6
13
15
*/
14
16
class ErrorTolerantConversionTest extends \PHPUnit \Framework \TestCase
15
17
{
16
- public function testIncompleteVar () : void
18
+ public function testIncompleteVar (): void
17
19
{
18
20
$ incomplete_contents = <<<'EOT'
19
21
<?php
@@ -30,7 +32,7 @@ function foo() {
30
32
$ this ->runTestFallbackFromParser ($ incomplete_contents , $ valid_contents );
31
33
}
32
34
33
- public function testIncompleteVarWithPlaceholderShort () : void
35
+ public function testIncompleteVarWithPlaceholderShort (): void
34
36
{
35
37
$ incomplete_contents = <<<'EOT'
36
38
<?php
@@ -43,7 +45,7 @@ public function testIncompleteVarWithPlaceholderShort() : void
43
45
$ this ->runTestFallbackFromParser ($ incomplete_contents , $ valid_contents , true );
44
46
}
45
47
46
- public function testIncompleteVarWithPlaceholder () : void
48
+ public function testIncompleteVarWithPlaceholder (): void
47
49
{
48
50
$ incomplete_contents = <<<'EOT'
49
51
<?php
@@ -60,7 +62,7 @@ function foo() {
60
62
$ this ->runTestFallbackFromParser ($ incomplete_contents , $ valid_contents , true );
61
63
}
62
64
63
- public function testIncompleteProperty () : void
65
+ public function testIncompleteProperty (): void
64
66
{
65
67
$ incomplete_contents = <<<'EOT'
66
68
<?php
@@ -79,7 +81,7 @@ function foo() {
79
81
$ this ->runTestFallbackFromParser ($ incomplete_contents , $ valid_contents );
80
82
}
81
83
82
- public function testIncompletePropertyWithPlaceholder () : void
84
+ public function testIncompletePropertyWithPlaceholder (): void
83
85
{
84
86
$ incomplete_contents = <<<'EOT'
85
87
<?php
@@ -98,7 +100,7 @@ function foo() {
98
100
$ this ->runTestFallbackFromParser ($ incomplete_contents , $ valid_contents , true );
99
101
}
100
102
101
- public function testIncompleteMethod () : void
103
+ public function testIncompleteMethod (): void
102
104
{
103
105
$ incomplete_contents = <<<'EOT'
104
106
<?php
@@ -117,7 +119,7 @@ function foo() {
117
119
$ this ->runTestFallbackFromParser ($ incomplete_contents , $ valid_contents );
118
120
}
119
121
120
- public function testIncompleteMethodWithPlaceholder () : void
122
+ public function testIncompleteMethodWithPlaceholder (): void
121
123
{
122
124
$ incomplete_contents = <<<'EOT'
123
125
<?php
@@ -136,7 +138,7 @@ function foo() {
136
138
$ this ->runTestFallbackFromParser ($ incomplete_contents , $ valid_contents , true );
137
139
}
138
140
139
- public function testMiscNoise () : void
141
+ public function testMiscNoise (): void
140
142
{
141
143
$ incomplete_contents = <<<'EOT'
142
144
<?php
@@ -155,7 +157,7 @@ function foo() {
155
157
$ this ->runTestFallbackFromParser ($ incomplete_contents , $ valid_contents );
156
158
}
157
159
158
- public function testMiscNoiseWithPlaceholders () : void
160
+ public function testMiscNoiseWithPlaceholders (): void
159
161
{
160
162
$ incomplete_contents = <<<'EOT'
161
163
<?php
@@ -174,7 +176,7 @@ function foo() {
174
176
$ this ->runTestFallbackFromParser ($ incomplete_contents , $ valid_contents , true );
175
177
}
176
178
177
- public function testIncompleteArithmeticWithPlaceholders () : void
179
+ public function testIncompleteArithmeticWithPlaceholders (): void
178
180
{
179
181
$ incomplete_contents = <<<'EOT'
180
182
<?php
@@ -191,7 +193,7 @@ function foo() {
191
193
$ this ->runTestFallbackFromParser ($ incomplete_contents , $ valid_contents , true );
192
194
}
193
195
194
- public function testIncompleteArithmeticWithoutPlaceholders () : void
196
+ public function testIncompleteArithmeticWithoutPlaceholders (): void
195
197
{
196
198
$ incomplete_contents = <<<'EOT'
197
199
<?php
@@ -208,7 +210,7 @@ function foo() {
208
210
$ this ->runTestFallbackFromParser ($ incomplete_contents , $ valid_contents , false );
209
211
}
210
212
211
- public function testMissingMember () : void
213
+ public function testMissingMember (): void
212
214
{
213
215
// in 0.0.17, this starts trying to parse a typed property declaration
214
216
// and discards all of it because it's invalid.
@@ -230,7 +232,7 @@ function aFunction() {}
230
232
$ this ->runTestFallbackFromParser ($ incomplete_contents , $ valid_contents , false );
231
233
}
232
234
233
- public function testIncompleteTypedProperty () : void
235
+ public function testIncompleteTypedProperty (): void
234
236
{
235
237
$ incomplete_contents = <<<'EOT'
236
238
<?php
@@ -251,7 +253,7 @@ public function aFunction() {}
251
253
$ this ->runTestFallbackFromParser ($ incomplete_contents , $ valid_contents , false );
252
254
}
253
255
254
- public function testEmptyConstList () : void
256
+ public function testEmptyConstList (): void
255
257
{
256
258
$ incomplete_contents = <<<'EOT'
257
259
<?php
@@ -264,7 +266,7 @@ class Test { }
264
266
$ this ->runTestFallbackFromParser ($ incomplete_contents , $ valid_contents , false );
265
267
}
266
268
267
- public function testMissingSemicolon () : void
269
+ public function testMissingSemicolon (): void
268
270
{
269
271
$ incomplete_contents = <<<'EOT'
270
272
<?php
@@ -283,7 +285,7 @@ function foo() {
283
285
$ this ->runTestFallbackFromParser ($ incomplete_contents , $ valid_contents );
284
286
}
285
287
286
- public function testIncompleteMethodCallBeforeIfWithPlaceholders () : void
288
+ public function testIncompleteMethodCallBeforeIfWithPlaceholders (): void
287
289
{
288
290
$ incomplete_contents = <<<'EOT'
289
291
<?php
@@ -309,7 +311,7 @@ public function testIncompleteMethodCallBeforeIfWithPlaceholders() : void
309
311
$ this ->runTestFallbackFromParser ($ incomplete_contents , $ valid_contents , true );
310
312
}
311
313
312
- public function testIncompleteMethodCallBeforeIfWithoutPlaceholders () : void
314
+ public function testIncompleteMethodCallBeforeIfWithoutPlaceholders (): void
313
315
{
314
316
$ incomplete_contents = <<<'EOT'
315
317
<?php
@@ -361,7 +363,7 @@ public function bar() {
361
363
EOT;
362
364
*/
363
365
364
- private static function normalizePolyfillAST (ast \Node $ ast ) : void
366
+ private static function normalizePolyfillAST (ast \Node $ ast ): void
365
367
{
366
368
switch ($ ast ->kind ) {
367
369
case ast \AST_DIM :
@@ -377,7 +379,7 @@ private static function normalizePolyfillAST(ast\Node $ast) : void
377
379
}
378
380
}
379
381
380
- private function runTestFallbackFromParser (string $ incomplete_contents , string $ valid_contents , bool $ should_add_placeholders = false ) : void
382
+ private function runTestFallbackFromParser (string $ incomplete_contents , string $ valid_contents , bool $ should_add_placeholders = false ): void
381
383
{
382
384
$ supports70 = ConversionTest::hasNativeASTSupport (70 );
383
385
if (!$ supports70 ) {
@@ -386,7 +388,7 @@ private function runTestFallbackFromParser(string $incomplete_contents, string $
386
388
$ this ->runTestFallbackFromParserForASTVersion ($ incomplete_contents , $ valid_contents , 70 , $ should_add_placeholders );
387
389
}
388
390
389
- private function runTestFallbackFromParserForASTVersion (string $ incomplete_contents , string $ valid_contents , int $ ast_version , bool $ should_add_placeholders ) : void
391
+ private function runTestFallbackFromParserForASTVersion (string $ incomplete_contents , string $ valid_contents , int $ ast_version , bool $ should_add_placeholders ): void
390
392
{
391
393
$ ast = \ast \parse_code ($ valid_contents , $ ast_version );
392
394
$ this ->assertInstanceOf ('\ast\Node ' , $ ast , 'Examples(for validContents) must be syntactically valid PHP parsable by php-ast ' );
0 commit comments