Skip to content

Commit 8d05d36

Browse files
authored
Merge pull request #53 from theodorejb/fix-short-closures
Update Short Closures spec to remove space after `fn` keyword
2 parents 110e3b1 + 6deac37 commit 8d05d36

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spec.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ $foo->bar(
11881188
Short closures, also known as arrow functions, MUST follow the same guidelines
11891189
and principles as long closures above, with the following additions.
11901190

1191-
The `fn` keyword MUST be preceded and succeeded by a space.
1191+
The `fn` keyword MUST be preceded by a space, and MUST NOT be succeeded by a space.
11921192

11931193
The `=>` symbol MUST be preceded and succeeded by a space.
11941194

@@ -1201,12 +1201,12 @@ The following examples show proper common usage of short closures.
12011201

12021202
```php
12031203

1204-
$func = fn (int $x, int $y): int => $x + $y;
1204+
$func = fn(int $x, int $y): int => $x + $y;
12051205

1206-
$func = fn (int $x, int $y): int
1206+
$func = fn(int $x, int $y): int
12071207
=> $x + $y;
12081208

1209-
$func = fn (
1209+
$func = fn(
12101210
int $x,
12111211
int $y,
12121212
): int

0 commit comments

Comments
 (0)