Change list() to array destruct
class SomeClass
{
public function run()
{
- list($id1, $name1) = $data;
+ [$id1, $name1] = $data;
- foreach ($data as list($id, $name)) {
+ foreach ($data as [$id, $name]) {
}
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Php71\Rector\List_\ListToArrayDestructRector;
return RectorConfig::configure()
->withRules([
ListToArrayDestructRector::class,
]);