@@ -131,7 +131,7 @@ Short form of type keywords MUST be used i.e. `bool` instead of `boolean`,
131131### 2.6 Trailing commas
132132
133133Numerous PHP constructs allow a sequence of values to be separated by a comma,
134- and the final item may have an optional comma. Examples include array key/value pairs,
134+ and the final item may have an optional comma. Examples include array key/value pairs,
135135function arguments, closure ` use ` statements, ` match() ` statement branches, etc.
136136
137137If that list is contained on a single line, then the last item MUST NOT have a trailing comma.
@@ -294,15 +294,15 @@ Any closing brace MUST NOT be followed by any comment or statement on the
294294same line.
295295
296296When instantiating a new class, parentheses MUST always be present even when
297- there are no arguments passed to the constructor. For example:
297+ there are no arguments passed to the constructor. For example:
298298
299299``` php
300300new Foo();
301301```
302302
303303If class contains no additional declarations (such as an exception that exists only extend another exception with a new type),
304304then the body of the class SHOULD be abbreviated as ` {} ` and placed on the same line as the previous symbol,
305- separated by a space. For example:
305+ separated by a space. For example:
306306
307307``` php
308308class MyException extends \RuntimeException {}
@@ -339,7 +339,7 @@ class ClassName extends ParentClass implements \ArrayAccess, \Countable
339339Lists of ` implements ` and, in the case of interfaces, ` extends ` MAY be split
340340across multiple lines, where each subsequent line is indented once. When doing
341341so, the first item in the list MUST be on the next line, and there MUST be only
342- one interface per line. For example:
342+ one interface per line. For example:
343343
344344``` php
345345<?php
@@ -514,7 +514,7 @@ function fooBarBaz($arg1, &$arg2, $arg3 = [])
514514
515515If a function or method contains no statements (such as a no-op implementation or when using
516516constructor property promotion), then the body SHOULD be abbreviated as ` {} ` and placed on the same
517- line as the previous symbol, separated by a space. For example:
517+ line as the previous symbol, separated by a space. For example:
518518
519519``` php
520520class Point
@@ -541,7 +541,7 @@ In the argument list, there MUST NOT be a space before each comma, and there
541541MUST be one space after each comma.
542542
543543Method and function parameters with default values MUST go at the end of the argument
544- list. For example:
544+ list. For example:
545545
546546``` php
547547<?php
@@ -563,7 +563,7 @@ next line, and there MUST be only one argument per line.
563563
564564When the argument list is split across multiple lines, the closing parenthesis
565565and opening brace MUST be placed together on their own line with one space
566- between them. For example:
566+ between them. For example:
567567
568568``` php
569569<?php
@@ -585,7 +585,7 @@ class ClassName
585585When you have a return type declaration present, there MUST be one space after
586586the colon followed by the type declaration. The colon and declaration MUST be
587587on the same line as the argument list closing parenthesis with no spaces between
588- the two characters. For example:
588+ the two characters. For example:
589589
590590``` php
591591<?php
@@ -612,7 +612,7 @@ class ReturnTypeVariations
612612```
613613
614614In nullable type declarations, there MUST NOT be a space between the question mark
615- and the type. For example:
615+ and the type. For example:
616616
617617``` php
618618<?php
@@ -656,7 +656,7 @@ public function process(string $algorithm, &...$parts)
656656### 4.6 Modifier Keywords
657657
658658Classes, properties, and methods have numerous keyword modifiers that alter how the
659- engine and language handles them. When present, they MUST be in the following order:
659+ engine and language handles them. When present, they MUST be in the following order:
660660
661661* Inheritance modifier: ` abstract ` or ` final `
662662* Visibility modifier: ` public ` , ` protected ` , or ` private `
@@ -743,14 +743,14 @@ $app->get('/hello/{name}', function ($name) use ($app) {
743743```
744744
745745If using named arguments, there MUST NOT be a space between the argument name
746- and colon, and there MUST be a single space between the colon and the argument value. For example:
746+ and colon, and there MUST be a single space between the colon and the argument value. For example:
747747
748748``` php
749749somefunction($a, b: $b, c: 'c');
750750```
751751
752752Method chaining MAY be put on separate lines, where each subsequent line is indented once. When doing so, the first
753- method MUST be on the next line. For example:
753+ method MUST be on the next line. For example:
754754
755755``` php
756756$someInstance
@@ -763,7 +763,7 @@ $someInstance
763763
764764A function or method may be referenced in a way that creates a closure out of it, by providing ` ... ` in place of arguments.
765765
766- If so, the ` ... ` MUST NOT include any whitespace before or after. That is, the correct format is ` foo(...) ` .
766+ If so, the ` ... ` MUST NOT include any whitespace before or after. That is, the correct format is ` foo(...) ` .
767767
768768## 5. Control Structures
769769
@@ -964,8 +964,7 @@ for ($i = 0; $i < 10; $i++) {
964964Expressions in parentheses MAY be split across multiple lines, where each
965965subsequent line is indented at least once. When doing so, the first expression
966966MUST be on the next line. The closing parenthesis and opening brace MUST be
967- placed together on their own line with one space between them. The semicolons
968- MUST be on the component they follow, not on the subsequent line. For example:
967+ placed together on their own line with one space between them. For example:
969968
970969``` php
971970<?php
@@ -1195,7 +1194,7 @@ The `=>` symbol MUST be preceded and succeeded by a space.
11951194
11961195The semicolon at the end of the expression MUST NOT be preceded by a space.
11971196
1198- The expression portion MAY be split to a subsequent line. If so, the ` => ` MUST be included
1197+ The expression portion MAY be split to a subsequent line. If so, the ` => ` MUST be included
11991198on the second line, and MUST be indented once.
12001199
12011200The following examples show proper common usage of short closures.
@@ -1261,13 +1260,13 @@ $instance = new class($a) extends \Foo implements
12611260
12621261Enumerations (enums) MUST follow the same guidelines as classes, except where otherwise noted below.
12631262
1264- Methods in enums MUST follow the same guidelines as methods in classes. Non-public methods MUST use ` private `
1263+ Methods in enums MUST follow the same guidelines as methods in classes. Non-public methods MUST use ` private `
12651264instead of ` protected ` , as enums do not support inheritance.
12661265
12671266When using a backed enum, there MUST NOT be a space between the enum name and colon, and there MUST be exactly one
1268- space between the colon and the backing type. This is consistent with the style for return types.
1267+ space between the colon and the backing type. This is consistent with the style for return types.
12691268
1270- Enum case declarations MUST use PascalCase capitalization. Enum case declarations MUST be on their own line.
1269+ Enum case declarations MUST use PascalCase capitalization. Enum case declarations MUST be on their own line.
12711270
12721271Constants in Enumerations MAY use either PascalCase or UPPER_CASE capitalization. PascalCase is RECOMMENDED,
12731272so that it is consistent with case declarations.
@@ -1429,12 +1428,12 @@ be placed on their own line, immediately prior to the structure being described.
14291428For attributes on parameters, if the parameter list is presented on a single line,
14301429the attribute MUST be placed inline with the parameter it describes, separated by a single space.
14311430If the parameter list is split into multiple lines for any reason, the attribute MUST be placed on
1432- its own line prior to the parameter, indented the same as the parameter. If the parameter list
1431+ its own line prior to the parameter, indented the same as the parameter. If the parameter list
14331432is split into multiple lines, a blank line MAY be included between one parameter and the attributes
14341433of the following parameter in order to aid readability.
14351434
14361435If a comment docblock is present on a structure that also includes an attribute, the comment block MUST
1437- come first, followed by any attributes, followed by the structure itself. There MUST NOT be any blank lines
1436+ come first, followed by any attributes, followed by the structure itself. There MUST NOT be any blank lines
14381437between the docblock and attributes, or the attributes and the structure.
14391438
14401439If two separate attribute blocks are used in a multi-line context, they MUST be on separate lines with no blank
@@ -1443,7 +1442,7 @@ lines between them.
14431442### 12.3 Compound attributes
14441443
14451444If multiple attributes are placed in the same attribute block, they MUST be separated by a comma with a space
1446- following but no space preceding. If the attribute list is split into multiple lines for any reason, then the
1445+ following but no space preceding. If the attribute list is split into multiple lines for any reason, then the
14471446attributes MUST be placed in separate attribute blocks. Those blocks may themselves contain multiple
14481447attributes provided this rule is respected.
14491448
0 commit comments