Skip to content

Incorrect behavior of RemoveReturnTagIncompatibleWithNativeTypeRector #9846

Description

@Philosoft

Bug Report

Subject Details
Rector version 2.6.1
Installed as composer dependency

Minimal PHP Code Causing Issue

See https://getrector.com/demo/e5aa473f-24cd-4583-8fef-a85632e51f96

<?php

/**
 * @phpstan-type ConfigArray array{is_dry: bool}
 * @phpstan-type CustomConfig array{}
 */
interface Configurable
{
    /** @return ConfigArray|CustomConfig */
    public function getConfig(): array;
}

Responsible rules

  • RemoveReturnTagIncompatibleWithNativeTypeRector

Expected Behavior

RemoveReturnTagIncompatibleWithNativeTypeRector should respect union types [for @phpstan-type types]

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