-
-
Notifications
You must be signed in to change notification settings - Fork 737
Open
rectorphp/rector-src
#7762Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | last dev-main |
| Installed as | composer dependency |
Minimal PHP Code Causing Issue
<?php
final class DemoFile
{
public function run(array $data)
{
}
public function execute()
{
return $this->run([$this, 'some']);
}
public function some()
{}
}Responsible rules
ArrayToFirstClassCallableRector
Expected Behavior
When used as argument, and caller requires array as type data, it should be skipped, or it will cause error:
Fatal error: Uncaught TypeError: DemoFile::run(): Argument #1 ($data) must be of type array, Closure given, called in /in/9sEbL on line 11 and defined in /in/9sEbL:5
see https://3v4l.org/9sEbL#v8.1.34