v2.4.0
-
Update slevomat/coding-standard to 6.2.0
-
Rewrite StroustrupSniff into two parts:
- StroustrupSniff
- DoWhileSniff
The first ensures that elseif, else, and catch are all on their own lines after the prior closing brace. The second ensures that the while of a do-while appears on its own line. By doing this, these sniffs are able to extend existing sniffs, and take advantage of their fixer code, as opposed to just reporting unfixable errors.
As such, running phpcbf on the following code:
if ($cond) {
} elseif ($cond2) {
} else {
}
try {
} catch ($exc) {
}
do {
}
while ($cond);
will get fixed as:
if ($cond) {
}
elseif ($cond2) {
}
else {
}
try {
}
catch ($exc) {
}
do {
}
while ($cond);