Change compact() call to own array
class SomeClass
{
public function run()
{
$checkout = 'one';
$form = 'two';
- return compact('checkout', 'form');
+ return ['checkout' => $checkout, 'form' => $form];
}
}
Configure your rector.php
:
<?php
use Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
CompactToVariablesRector::class,
]);