pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/php-fig/per-coding-style/commit/6794b0a4837180a20e6cc8dd5cd4970efeb61bd5

/> Allow 2 syntaxes · php-fig/per-coding-style@6794b0a · GitHub
Skip to content

Commit 6794b0a

Browse files
committed
Allow 2 syntaxes
1 parent 07e0467 commit 6794b0a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

spec.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,10 +1399,17 @@ $closureWithArgsVarsAndReturn = function ($arg1, $arg2) use ($var1, $var2): bool
13991399
};
14001400
```
14011401

1402-
If a closure contains no statements, it MUST use the "arrow function" style syntax:
1402+
If a closure contains no statements, then the body MUST be abbreviated as `{}` and placed on the same
1403+
line as the previous symbol, separated by a space:
14031404

14041405
```php
1405-
fn() => null;
1406+
$noOpFunction = function () {};
1407+
```
1408+
1409+
If possible, empty-body closures SHOULD be replaced with arrow functions:
1410+
1411+
```php
1412+
$noOpFunction = fn() => null;
14061413
```
14071414

14081415
Argument lists and variable lists MAY be split across multiple lines, where

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy