Skip to content

Incorrect behavior of CombineIfRector #9717

@sreichel

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/7a2d362e-2864-4b8b-9bdc-e656c2fce98f

Responsible rules

  • CombineIfRector

Expected Behavior

The rule should only append/combine if-condition, not changing logic.

<?php

final class DemoFile
{
    protected function some(array $data, string $fieldSet, string $field, bool $skipIfConfigValueUsed = false)
    {
        if (!($skipIfConfigValueUsed && $this->other()) && isset($data[$field])) {
        }
    }
    
    protected function other() {}
}

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