Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phpcbf parse problem, wrong brace placement for inline IF #372

Closed
chandon opened this issue Dec 17, 2014 · 2 comments
Closed

phpcbf parse problem, wrong brace placement for inline IF #372

chandon opened this issue Dec 17, 2014 · 2 comments

Comments

@chandon
Copy link

chandon commented Dec 17, 2014

When running phpcbf on this code

<?php
function fname($param) 
{       
    if ($a)
        foreach ($b as $c) {                
            if ($d) {
                $e=$f;
                $g=$h;
            } elseif ($i==0) {
                $j=$k;
            }
        }           

    return $m;
}
?>

i get this wrong result

<?php
function fname($param) 
{       
    if ($a) {
        foreach ($b as $c) {                
            if ($d) {
                $e=$f; 
            }
            $g=$h;
        } elseif ($i==0) {
            $j=$k;
        }
    }           

    return $m;
}
?>
@chandon chandon changed the title BUG : phpcbf breaks my code BUG : phpcbf parse problem Dec 17, 2014
@chandon chandon changed the title BUG : phpcbf parse problem BUG : phpcbf parse problem, wrong } Dec 17, 2014
@chandon chandon changed the title BUG : phpcbf parse problem, wrong } BUG : phpcbf parse problem, wrong } place Dec 17, 2014
@gsherwood gsherwood changed the title BUG : phpcbf parse problem, wrong } place phpcbf parse problem, wrong brace placement for inline IF Dec 17, 2014
@gsherwood
Copy link
Member

Thanks for reporting this. It has been fixed now.

@chandon
Copy link
Author

chandon commented Dec 18, 2014

Perfectly working, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants