Removes unneeded curly braces that are superfluous and aren't part of a control structure's body.
You should use no_unneeded_braces
instead.
Remove unneeded curly braces from bracketed namespaces.
Allowed types: bool
Default value: false
Default configuration.
--- Original
+++ New
-<?php {
+<?php
echo 1;
-}
+
switch ($b) {
- case 1: {
+ case 1:
break;
- }
+
}
With configuration: ['namespaces' => true]
.
--- Original
+++ New
<?php
-namespace Foo {
+namespace Foo;
function Bar(){}
-}
+
PhpCsFixer\Fixer\ControlStructure\NoUnneededCurlyBracesFixer