Skip to content

Braces - do while loop gets broken#4721

Closed
GrahamCampbell wants to merge 1 commit intoPHP-CS-Fixer:2.15from
GrahamCampbell:patch-2
Closed

Braces - do while loop gets broken#4721
GrahamCampbell wants to merge 1 commit intoPHP-CS-Fixer:2.15from
GrahamCampbell:patch-2

Conversation

@GrahamCampbell
Copy link
Copy Markdown
Contributor

@GrahamCampbell GrahamCampbell commented Jan 4, 2020

The braces fixer is fixing:

<?php
function f()
{
    do {
        foo();
    } //
    while (false);
}

to:

<?php
function f()
{
    do {
        foo();
    } // while (false);
}

which is invalid syntax.


By comparison, the braces fixer leaves the following unchanged:

<?php

do {
    foo();
} //
while (false);

@SpacePossum SpacePossum changed the title Broken braces fixer Braces - do while loop gets broken Feb 27, 2020
@julienfalque julienfalque marked this pull request as draft April 10, 2020 08:43
@julienfalque
Copy link
Copy Markdown
Member

I added this test case into #4884 and it passes so I'm closing here in favor of #4884.

@julienfalque julienfalque mentioned this pull request Apr 10, 2020
6 tasks
@GrahamCampbell GrahamCampbell deleted the patch-2 branch April 12, 2020 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants