Skip to content

Update Short Closures spec to remove space after fn keyword #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@ $foo->bar(
Short closures, also known as arrow functions, MUST follow the same guidelines
and principles as long closures above, with the following additions.

The `fn` keyword MUST be preceded and succeeded by a space.
The `fn` keyword MUST be preceded by a space, and MUST NOT be succeeded by a space.

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

Expand All @@ -1161,12 +1161,12 @@ The following examples show proper common usage of short closures.

```php

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

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

$func = fn (
$func = fn(
int $x,
int $y,
): int
Expand Down