Skip to content

Incorrect behavior of CompleteMissingIfElseBracketRector (inline braces) #9725

Description

@sreichel

Bug Report

Subject Details
Rector version last dev-main
Installed as composer dependency

Minimal PHP Code Causing Issue

See https://getrector.com/demo/165069a0-0e07-4ab0-b2c2-cda860a65d4f

<?php
# its a .phtml file
?>
<p>html</p>
<?php if ($cond) continue; ?>

Responsible rules

  • CompleteMissingIfElseBracketRector

Expected Behavior

Not sure if thats changable. If opening/closing php-tag is on same line, add braces in-line.

<?php
# its a .phtml file
?>
<p>html</p>
<?php if ($cond) { continue; } ?>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions