Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect behavior of TernaryToNullCoalescingRector #8309

Closed
staabm opened this issue Nov 15, 2023 · 1 comment · Fixed by rectorphp/rector-src#5251
Closed

Incorrect behavior of TernaryToNullCoalescingRector #8309

staabm opened this issue Nov 15, 2023 · 1 comment · Fixed by rectorphp/rector-src#5251
Assignees
Labels

Comments

@staabm
Copy link
Contributor

staabm commented Nov 15, 2023

Bug Report

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

Minimal PHP Code Causing Issue

See https://getrector.com/demo/6129e6f8-3726-4d26-b961-306b42af6be6

<?php

use shop\product\business\ProductFilter;

class ProductController
{
    private function sharedProductFilter(): void
    {
        $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1;

        $this->brands = Hersteller::getListForProducts(new \ProductFilter());
    }

}

Responsible rules

  • TernaryToNullCoalescingRector

Expected Behavior

the fqcn should not be modified, since it after the change collides with a same named class already imported

@staabm staabm added the bug label Nov 15, 2023
@samsonasik
Copy link
Member

Thank you, it seems only happen on TernaryToNullCoalescingRector, I will look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants