Skip to content

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

@chandon

Description

@chandon

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;
}
?>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions