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);
372372Result:
373373
374374``` php
375- fn ($a, $b) => $a + $b
375+ fn($a, $b) => $a + $b
376376```
377377
378378Attributes
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ public function printArrowFunction(Closure $closure): string
8181 }
8282
8383 return self ::printAttributes ($ closure ->getAttributes (), null )
84- . 'fn '
84+ . 'fn '
8585 . ($ closure ->getReturnReference () ? '& ' : '' )
8686 . $ this ->printParameters ($ closure , null )
8787 . $ this ->printReturnType ($ closure , null )
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ $function
1818$ function ->addParameter ('a ' );
1919$ function ->addParameter ('b ' );
2020
21- Assert::same ('fn &($a, $b) => $a + $b; ' , (new Printer )->printArrowFunction ($ function ));
21+ Assert::same ('fn&($a, $b) => $a + $b; ' , (new Printer )->printArrowFunction ($ function ));
2222
2323
2424
@@ -27,7 +27,7 @@ $function
2727 ->setReturnType ('array ' )
2828 ->setBody ('[] ' );
2929
30- Assert::same ('fn (): array => []; ' , (new Printer )->printArrowFunction ($ function ));
30+ Assert::same ('fn(): array => []; ' , (new Printer )->printArrowFunction ($ function ));
3131
3232
3333Assert::exception (function () {
You can’t perform that action at this time.
0 commit comments