Skip to content

nette/utils 4.0 cause error RectorPrefix202403\Nette\Utils\Reflection::getUseStatements(): Return value must be of type array, null returned  #8565

@samsonasik

Description

@samsonasik

Bug Report

Subject Details
Rector version dev-main

Minimal PHP Code Causing Issue

Ref rectorphp/getrector-com#2142

also reproducible locally on other project:

➜  ErrorHeroModule git:(master) bin/rector 
 58/58 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
                                                                                                                        
 [ERROR] Could not process "/Users/samsonasik/www/GithubModules/ErrorHeroModule/src/Listener/MvcFactory.php" file, due  
         to:                                                                                                            
         "System error: "RectorPrefix202403\Nette\Utils\Reflection::getUseStatements(): Return value must be of type    
         array, null returned"                                                                                          
         Run Rector with "--debug" option and post the report here: https://github.com/rectorphp/rector/issues/new". On line: 158

The issue seems when it used on Reflection::expandClassName()

$fullyQualifiedName = Reflection::expandClassName($shortName, $nativeReflectionClass);

Expected Behaviour

It should works.

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