Closed
Description
Bug Report
Subject | Details |
---|---|
Rector version | last dev-main |
Installed as | composer dependency |
Minimal PHP Code Causing Issue
See https://getrector.com/demo/8c5d72b6-135f-43c4-8688-d4976d7ce331
<?php
class DemoFile
{
public function run(bool $param)
{
return array_filter($this->value ?? []);
}
}
Responsible rules
ReturnTypeFromStrictNativeCallRector
Expected Behavior
return array_filter ought to always be typed as array. This only seems to be an issue if $this->value is dynamic or typed as mixed. When typed as 'array', the expected behaviour is there.
Activity