Skip to content

Incorrect behavior of MixedTypeRector #8648

@p4veI

Description

@p4veI

Bug Report

Hello after installing rector v1.1.0 rector randomly caused removal of iterable type doc type hint as per the following example. I believe this is an incorrect behaviour caused by rectorphp/rector-src#5874

Thanks for all the good work!

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

Minimal PHP Code Causing Issue

See https://getrector.com/demo/e0f3fe31-6aac-49fb-8f3b-7d8b86365baa

<?php

final class DemoFile
{
    /**
     * @param iterable<K, V>&Countable $iterable
     *
     * @template K
     * @template V
     */
    public function run(iterable $iterable)
    {
    }
}

Responsible rules

  • MixedTypeRector

Expected Behavior

No changes.

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