diff --git a/spec.md b/spec.md index c478084..50fc26e 100644 --- a/spec.md +++ b/spec.md @@ -1399,6 +1399,19 @@ $closureWithArgsVarsAndReturn = function ($arg1, $arg2) use ($var1, $var2): bool }; ``` +If a closure contains no statements, then the body MUST be abbreviated as `{}` and placed on the same +line as the previous symbol, separated by a space: + +```php +$noOpFunction = function () {}; +``` + +If possible, empty-body closures SHOULD be replaced with arrow functions: + +```php +$noOpFunction = fn() => null; +``` + Argument lists and variable lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument or variable