ExtractArrayArgOnQueryBuilderSelectRector

Extract array arg on QueryBuilder select, addSelect, groupBy, addGroupBy

 function query(\Doctrine\DBAL\Query\QueryBuilder $queryBuilder)
 {
-    $query = $queryBuilder->select(['u.id', 'p.id']);
+    $query = $queryBuilder->select('u.id', 'p.id');
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\Doctrine\Dbal211\Rector\MethodCall\ExtractArrayArgOnQueryBuilderSelectRector;

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