MappingArrayAccessToPropertyFetchRector

Change deprecated array access on ORM mapping objects to property fetch

 use Doctrine\ORM\Mapping\FieldMapping;

 function run(FieldMapping $fieldMapping)
 {
-    return $fieldMapping['columnName'];
+    return $fieldMapping->columnName;
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\Doctrine\Orm31\Rector\ArrayDimFetch\MappingArrayAccessToPropertyFetchRector;

return RectorConfig::configure()
    ->withRules([
        MappingArrayAccessToPropertyFetchRector::class,
    ]);
PACKAGE:  doctrine/orm >=3.1 <6.0

Other rules in the doctrine/orm set