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 StrictArrayParamDimFetchRector on default value string type #8317

Closed
samsonasik opened this issue Nov 18, 2023 · 0 comments · Fixed by rectorphp/rector-src#5259
Labels

Comments

@samsonasik
Copy link
Member

samsonasik commented Nov 18, 2023

Bug Report

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

Minimal PHP Code Causing Issue

See https://getrector.com/demo/939b4537-6cd7-4b8d-80cb-6719b52d1280

<?php

final class DemoFile
{
    public function run($param = 'foo')
    {
	 if (isset($param['bar'])) {
            echo $param['bar'];
        }
        
        echo $param;
    }
}

Responsible rules

  • StrictArrayParamDimFetchRector

Expected Behavior

Should be skipped or make it array|string

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

Successfully merging a pull request may close this issue.

1 participant