RemoveNullFromInstantiatedArrayCollectionPropertyRector

Remove nullability from instantiated ArrayCollection properties, set it to Collection

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

 class SomeClass
 {
-    private ?Collection $trainings = null;
+    private Collection $trainings;

     public function __construct()
     {
         $this->trainings = new ArrayCollection();
     }
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\Doctrine\TypedCollections\Rector\Class_\RemoveNullFromInstantiatedArrayCollectionPropertyRector;

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