NarrowArrayCollectionUnionReturnDocblockRector

Change @return "Type[]|ArrayCollection" union docblock to a generic "ArrayCollection"

 use Doctrine\Common\Collections\ArrayCollection;

 class SomeClass
 {
     /**
-     * @return LeadEventLog[]|ArrayCollection
+     * @return ArrayCollection<int, LeadEventLog>
      */
     public function getSuccessful(): ArrayCollection
     {
         return $this->successful;
     }
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\TypeDeclarationDocblocks\Rector\ClassMethod\NarrowArrayCollectionUnionReturnDocblockRector;

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