JoinStringConcatRector

Joins concat of 2 strings, unless the length is too long

 class SomeClass
 {
     public function run()
     {
-        $name = 'Hi' . ' Tom';
+        $name = 'Hi Tom';
     }
 }

Configure your rector.php:

<?php

use Rector\CodeQuality\Rector\Concat\JoinStringConcatRector;
use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withRules([
        JoinStringConcatRector::class,
    ]);
SETS:  Code Quality