2020-07-18 18:57:24 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
|
|
|
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
|
|
|
2020-07-18 19:00:36 +02:00
|
|
|
# see: https://laravel.com/docs/5.0/upgrade
|
2020-07-18 18:57:24 +02:00
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
|
|
|
$services = $containerConfigurator->services();
|
|
|
|
|
2020-07-18 19:00:36 +02:00
|
|
|
# https://stackoverflow.com/a/24949656/1348344
|
2020-07-18 18:57:24 +02:00
|
|
|
$services->set(RenameClassRector::class)
|
2020-07-30 00:43:06 +02:00
|
|
|
->call('configure', [[
|
|
|
|
'$oldToNewClasses' => [
|
|
|
|
'Illuminate\Cache\CacheManager' => 'Illuminate\Contracts\Cache\Repository',
|
|
|
|
'Illuminate\Database\Eloquent\SoftDeletingTrait' => 'Illuminate\Database\Eloquent\SoftDeletes',
|
|
|
|
],
|
|
|
|
]]);
|
2020-07-18 18:57:24 +02:00
|
|
|
|
|
|
|
$services->set(RenameMethodRector::class)
|
2020-07-30 00:43:06 +02:00
|
|
|
->call('configure', [[
|
|
|
|
'$oldToNewMethodsByClass' => [
|
|
|
|
'Illuminate\Contracts\Pagination\Paginator' => [
|
|
|
|
'links' => 'render',
|
|
|
|
'getFrom' => 'firstItem',
|
|
|
|
'getTo' => 'lastItem',
|
|
|
|
'getPerPage' => 'perPage',
|
|
|
|
'getCurrentPage' => 'currentPage',
|
|
|
|
'getLastPage' => 'lastPage',
|
|
|
|
'getTotal' => 'total',
|
|
|
|
],
|
2020-07-18 18:57:24 +02:00
|
|
|
],
|
2020-07-30 00:43:06 +02:00
|
|
|
]]);
|
2020-07-18 18:57:24 +02:00
|
|
|
};
|