File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -372,7 +372,7 @@ echo (new Nette\PhpGenerator\Printer)->printArrowFunction($closure);
372
372
Result:
373
373
374
374
``` php
375
- fn ($a, $b) => $a + $b
375
+ fn($a, $b) => $a + $b
376
376
```
377
377
378
378
Attributes
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ public function printArrowFunction(Closure $closure): string
81
81
}
82
82
83
83
return self ::printAttributes ($ closure ->getAttributes (), null )
84
- . 'fn '
84
+ . 'fn '
85
85
. ($ closure ->getReturnReference () ? '& ' : '' )
86
86
. $ this ->printParameters ($ closure , null )
87
87
. $ this ->printReturnType ($ closure , null )
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ $function
18
18
$ function ->addParameter ('a ' );
19
19
$ function ->addParameter ('b ' );
20
20
21
- Assert::same ('fn &($a, $b) => $a + $b; ' , (new Printer )->printArrowFunction ($ function ));
21
+ Assert::same ('fn&($a, $b) => $a + $b; ' , (new Printer )->printArrowFunction ($ function ));
22
22
23
23
24
24
@@ -27,7 +27,7 @@ $function
27
27
->setReturnType ('array ' )
28
28
->setBody ('[] ' );
29
29
30
- Assert::same ('fn (): array => []; ' , (new Printer )->printArrowFunction ($ function ));
30
+ Assert::same ('fn(): array => []; ' , (new Printer )->printArrowFunction ($ function ));
31
31
32
32
33
33
Assert::exception (function () {
You can’t perform that action at this time.
0 commit comments