@@ -65,7 +65,7 @@ class Foo extends Bar implements FooInterface
65
65
66
66
final public static function bar()
67
67
{
68
- // method body
68
+ // ...
69
69
}
70
70
}
71
71
@@ -226,7 +226,7 @@ use const Another\Vendor\CONSTANT_D;
226
226
*/
227
227
class FooBar
228
228
{
229
- // ... additional PHP code ...
229
+ // ...
230
230
}
231
231
```
232
232
@@ -250,7 +250,7 @@ And the following would not be allowed:
250
250
<?php
251
251
252
252
use Vendor\Package\SomeNamespace\{
253
- // This has too many namespace segments to be in a group.
253
+ // This has too many namespace segments to be in a group
254
254
SubnamespaceOne\AnotherNamespace\ClassA,
255
255
SubnamespaceOne\ClassB,
256
256
ClassZ,
@@ -268,7 +268,7 @@ For example:
268
268
<html >
269
269
<body >
270
270
<?php
271
- // ... additional PHP code ...
271
+ // ...
272
272
?>
273
273
</body >
274
274
</html >
@@ -282,7 +282,7 @@ braces and spacing:
282
282
283
283
``` php
284
284
declare(ticks=1) {
285
- // some code
285
+ // ...
286
286
}
287
287
```
288
288
@@ -332,7 +332,7 @@ use OtherVendor\OtherPackage\BazClass;
332
332
333
333
class ClassName extends ParentClass implements \ArrayAccess, \Countable
334
334
{
335
- // constants, properties, methods
335
+ // ...
336
336
}
337
337
```
338
338
@@ -355,7 +355,7 @@ class ClassName extends ParentClass implements
355
355
\Countable,
356
356
\Serializable
357
357
{
358
- // constants, properties, methods
358
+ // ...
359
359
}
360
360
```
361
361
@@ -494,7 +494,7 @@ class ClassName
494
494
{
495
495
public function fooBarBaz($arg1, & $arg2, $arg3 = [])
496
496
{
497
- // method body
497
+ // ...
498
498
}
499
499
}
500
500
```
@@ -507,7 +507,7 @@ parentheses, commas, spaces, and braces:
507
507
508
508
function fooBarBaz($arg1, & $arg2, $arg3 = [])
509
509
{
510
- // function body
510
+ // ...
511
511
}
512
512
```
513
513
@@ -551,7 +551,7 @@ class ClassName
551
551
{
552
552
public function foo(int $arg1, & $arg2, $arg3 = [])
553
553
{
554
- // method body
554
+ // ...
555
555
}
556
556
}
557
557
```
@@ -576,7 +576,7 @@ class ClassName
576
576
& $arg2,
577
577
array $arg3 = [],
578
578
) {
579
- // method body
579
+ // ...
580
580
}
581
581
}
582
582
```
@@ -638,7 +638,7 @@ name:
638
638
``` php
639
639
public function process(string $algorithm, ...$parts)
640
640
{
641
- // processing
641
+ // ...
642
642
}
643
643
```
644
644
@@ -648,7 +648,7 @@ there MUST NOT be any space between the two of them:
648
648
``` php
649
649
public function process(string $algorithm, & ...$parts)
650
650
{
651
- // processing
651
+ // ...
652
652
}
653
653
```
654
654
@@ -683,7 +683,7 @@ abstract class ClassName
683
683
684
684
final public static function bar()
685
685
{
686
- // method body
686
+ // ...
687
687
}
688
688
}
689
689
@@ -791,11 +791,11 @@ closing brace from the earlier body.
791
791
<?php
792
792
793
793
if ($expr1) {
794
- // if body
794
+ // ...
795
795
} elseif ($expr2) {
796
- // elseif body
796
+ // ...
797
797
} else {
798
- // else body;
798
+ // ...
799
799
}
800
800
```
801
801
@@ -818,12 +818,12 @@ if (
818
818
$expr1
819
819
&& $expr2
820
820
) {
821
- // if body
821
+ // ...
822
822
} elseif (
823
823
$expr3
824
824
&& $expr4
825
825
) {
826
- // elseif body
826
+ // ...
827
827
}
828
828
```
829
829
@@ -833,7 +833,7 @@ A `switch` structure looks like the following. Note the placement of
833
833
parentheses, spaces, and braces. The ` case ` statement MUST be indented once
834
834
from ` switch ` , and the ` break ` keyword (or other terminating keywords) MUST be
835
835
indented at the same level as the ` case ` body. There MUST be a comment such as
836
- ` // no break ` when fall-through is intentional in a non-empty ` case ` body.
836
+ ` // No break ` when fall-through is intentional in a non-empty ` case ` body.
837
837
838
838
``` php
839
839
<?php
@@ -844,7 +844,7 @@ switch ($expr) {
844
844
break;
845
845
case 1:
846
846
echo 'Second case, which falls through';
847
- // no break
847
+ // No break
848
848
case 2:
849
849
case 3:
850
850
case 4:
@@ -872,7 +872,7 @@ switch (
872
872
$expr1
873
873
&& $expr2
874
874
) {
875
- // structure body
875
+ // ...
876
876
}
877
877
```
878
878
@@ -898,7 +898,7 @@ parentheses, spaces, and braces.
898
898
<?php
899
899
900
900
while ($expr) {
901
- // structure body
901
+ // ...
902
902
}
903
903
```
904
904
@@ -916,7 +916,7 @@ while (
916
916
$expr1
917
917
&& $expr2
918
918
) {
919
- // structure body
919
+ // ...
920
920
}
921
921
```
922
922
@@ -927,7 +927,7 @@ of parentheses, spaces, and braces.
927
927
<?php
928
928
929
929
do {
930
- // structure body;
930
+ // ...
931
931
} while ($expr);
932
932
```
933
933
@@ -940,7 +940,7 @@ always be at the beginning or at the end of the line, not a mix of both. For exa
940
940
<?php
941
941
942
942
do {
943
- // structure body;
943
+ // ...
944
944
} while (
945
945
$expr1
946
946
&& $expr2
@@ -956,7 +956,7 @@ spaces, and braces.
956
956
<?php
957
957
958
958
for ($i = 0; $i < 10; $i++) {
959
- // for body
959
+ // ...
960
960
}
961
961
```
962
962
@@ -973,7 +973,7 @@ for (
973
973
$i < 10;
974
974
$i++
975
975
) {
976
- // for body
976
+ // ...
977
977
}
978
978
```
979
979
@@ -986,7 +986,7 @@ parentheses, spaces, and braces.
986
986
<?php
987
987
988
988
foreach ($iterable as $key => $value) {
989
- // foreach body
989
+ // ...
990
990
}
991
991
```
992
992
@@ -999,13 +999,13 @@ parentheses, spaces, and braces.
999
999
<?php
1000
1000
1001
1001
try {
1002
- // try body
1002
+ // ...
1003
1003
} catch (FirstThrowableType $e) {
1004
- // catch body
1004
+ // ...
1005
1005
} catch (OtherThrowableType | AnotherThrowableType $e) {
1006
- // catch body
1006
+ // ...
1007
1007
} finally {
1008
- // finally body
1008
+ // ...
1009
1009
}
1010
1010
```
1011
1011
@@ -1095,15 +1095,15 @@ parentheses, commas, spaces, and braces:
1095
1095
<?php
1096
1096
1097
1097
$closureWithArgs = function ($arg1, $arg2) {
1098
- // body
1098
+ // ...
1099
1099
};
1100
1100
1101
1101
$closureWithArgsAndVars = function ($arg1, $arg2) use ($var1, $var2) {
1102
- // body
1102
+ // ...
1103
1103
};
1104
1104
1105
1105
$closureWithArgsVarsAndReturn = function ($arg1, $arg2) use ($var1, $var2): bool {
1106
- // body
1106
+ // ...
1107
1107
};
1108
1108
```
1109
1109
@@ -1127,15 +1127,15 @@ $longArgs_noVars = function (
1127
1127
$longerArgument,
1128
1128
$muchLongerArgument,
1129
1129
) {
1130
- // body
1130
+ // ...
1131
1131
};
1132
1132
1133
1133
$noArgs_longVars = function () use (
1134
1134
$longVar1,
1135
1135
$longerVar2,
1136
1136
$muchLongerVar3,
1137
1137
) {
1138
- // body
1138
+ // ...
1139
1139
};
1140
1140
1141
1141
$longArgs_longVars = function (
@@ -1147,23 +1147,23 @@ $longArgs_longVars = function (
1147
1147
$longerVar2,
1148
1148
$muchLongerVar3,
1149
1149
) {
1150
- // body
1150
+ // ...
1151
1151
};
1152
1152
1153
1153
$longArgs_shortVars = function (
1154
1154
$longArgument,
1155
1155
$longerArgument,
1156
1156
$muchLongerArgument,
1157
1157
) use ($var1) {
1158
- // body
1158
+ // ...
1159
1159
};
1160
1160
1161
1161
$shortArgs_longVars = function ($arg) use (
1162
1162
$longVar1,
1163
1163
$longerVar2,
1164
1164
$muchLongerVar3,
1165
1165
) {
1166
- // body
1166
+ // ...
1167
1167
};
1168
1168
```
1169
1169
@@ -1176,7 +1176,7 @@ in a function or method call as an argument.
1176
1176
$foo->bar(
1177
1177
$arg1,
1178
1178
function ($arg2) use ($var1) {
1179
- // body
1179
+ // ...
1180
1180
},
1181
1181
$arg3,
1182
1182
);
@@ -1237,7 +1237,7 @@ If the anonymous class has no arguments, the `()` after `class` MUST be omitted.
1237
1237
// Brace on the same line
1238
1238
// No arguments
1239
1239
$instance = new class extends \Foo implements \HandleableInterface {
1240
- // Class content
1240
+ // ...
1241
1241
};
1242
1242
1243
1243
// Brace on the next line
@@ -1250,7 +1250,7 @@ $instance = new class($a) extends \Foo implements
1250
1250
public function __construct(public int $a)
1251
1251
{
1252
1252
}
1253
- // Class content
1253
+ // ...
1254
1254
};
1255
1255
```
1256
1256
0 commit comments