Skip to content

Incorrect behavior of RemoveUnreachableStatementRector #7957

@csicso1962

Description

@csicso1962

Bug Report

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

Minimal PHP Code Causing Issue

See https://getrector.com/demo/75c05890-19ae-43c6-99af-23571522354d

<?php

final class DemoFile
{
    public function run()
    {
        return 5;

        // we never get here
        return 10;
    }
}

Responsible rules

  • RemoveUnreachableStatementRector

Expected Behavior

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    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