SetArrayToNewCollectionRector

Change array to new ArrayCollection() on collection typed property

 use Doctrine\Common\Collections\ArrayCollection;
+use Doctrine\Common\Collections\Collection;

 final class SomeClass
 {
     /**
-     * @var ArrayCollection<int, string>
+     * @var Collection<int, string>
      */
     public $items;

     public function someMethod()
     {
-        $this->items = [];
+        $this->items = new ArrayCollection([]);
     }
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\Doctrine\TypedCollections\Rector\MethodCall\SetArrayToNewCollectionRector;

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