AddArrowFunctionReturnTypeRector

Add known return type to arrow function

-fn () => [];
+fn (): array => [];

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector;

return RectorConfig::configure()
    ->withRules([
        AddArrowFunctionReturnTypeRector::class,
    ]);