Run Rector on your code to see what it can do for you:
<?php final class DemoFile { - /** - * @return Iterator<DemoFile> - */ - public function run(): Iterator + /** + * @return \ArrayIterator<DemoFile> + */ + public function run(): \ArrayIterator { $arr = [new DemoFile]; return new ArrayIterator($arr); } }
Applied Rules:
Not a change you expect?
rector.php