2020-10-31 15:23:33 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
|
|
|
use Rector\Renaming\Rector\Name\RenameClassRector;
|
|
|
|
use Rector\Renaming\ValueObject\MethodCallRename;
|
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
2020-11-26 17:44:27 +01:00
|
|
|
use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
2020-10-31 15:23:33 -04:00
|
|
|
|
|
|
|
# source: https://book.cakephp.org/4/en/appendices/4-2-migration-guide.html
|
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
|
|
|
$services = $containerConfigurator->services();
|
|
|
|
|
|
|
|
$services->set(RenameClassRector::class)
|
|
|
|
->call('configure', [[
|
|
|
|
RenameClassRector::OLD_TO_NEW_CLASSES => [
|
|
|
|
'Cake\Core\Exception\Exception' => 'Cake\Core\Exception\CakeException',
|
|
|
|
'Cake\Database\Exception' => 'Cake\Database\Exception\DatabaseException',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
]);
|
|
|
|
|
|
|
|
$services->set(RenameMethodRector::class)
|
|
|
|
->call('configure', [[
|
2020-11-26 17:44:27 +01:00
|
|
|
RenameMethodRector::METHOD_CALL_RENAMES => ValueObjectInliner::inline([
|
2020-10-31 15:23:33 -04:00
|
|
|
new MethodCallRename('Cake\ORM\Behavior', 'getTable', 'table'),
|
|
|
|
]),
|
|
|
|
]]);
|
|
|
|
};
|