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 TypedPropertyFromAssignsRector #8928

Closed
yguedidi opened this issue Dec 11, 2024 · 0 comments · Fixed by rectorphp/rector-src#6562
Closed

Incorrect behavior of TypedPropertyFromAssignsRector #8928

yguedidi opened this issue Dec 11, 2024 · 0 comments · Fixed by rectorphp/rector-src#6562
Labels

Comments

@yguedidi
Copy link

Bug Report

Subject Details
Rector version 1.2.10
Installed as composer dependency

Minimal PHP Code Causing Issue

See https://getrector.com/demo/a0c60c4c-6471-4028-bf9b-f1f1660ccdba

<?php

final class DemoFile
{
    private $host = null;
    
    public function _cosntructor(string $url)
    {
        $this->host = parse_url($url, \PHP_URL_HOST);
    }
}

Responsible rules

  • TypedPropertyFromAssignsRector

Expected Behavior

see https://www.php.net/manual/en/function.parse-url.php
When the component parameter is passed, parse_url returns string|null (or int|null for the specific \PHP_URL_PORT component)

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