2020-07-18 18:57:24 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-08-18 17:57:30 +02:00
|
|
|
use Rector\Generic\Rector\PropertyFetch\RenamePropertyRector;
|
2020-07-18 18:57:24 +02:00
|
|
|
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
2020-08-18 17:57:30 +02:00
|
|
|
use Rector\Renaming\Rector\Name\RenameClassRector;
|
2020-08-25 00:26:14 +02:00
|
|
|
use Rector\Renaming\ValueObject\MethodCallRename;
|
|
|
|
use function Rector\SymfonyPhpConfig\inline_value_objects;
|
2020-07-18 18:57:24 +02:00
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
|
|
|
2020-07-18 19:00:36 +02:00
|
|
|
# see: https://laravel.com/docs/5.5/upgrade
|
|
|
|
|
2020-07-18 18:57:24 +02:00
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
|
|
|
$services = $containerConfigurator->services();
|
|
|
|
|
|
|
|
$services->set(RenameMethodRector::class)
|
2020-07-30 00:43:06 +02:00
|
|
|
->call('configure', [[
|
2020-08-25 00:26:14 +02:00
|
|
|
RenameMethodRector::OLD_TO_NEW_METHODS_BY_CLASS => inline_value_objects([
|
|
|
|
new MethodCallRename('Illuminate\Console\Command', 'fire', 'handle'),
|
|
|
|
]),
|
2020-07-30 00:43:06 +02:00
|
|
|
]]);
|
2020-07-18 18:57:24 +02:00
|
|
|
|
|
|
|
$services->set(RenamePropertyRector::class)
|
2020-07-30 00:43:06 +02:00
|
|
|
->call('configure', [[
|
2020-07-30 01:39:41 +02:00
|
|
|
RenamePropertyRector::OLD_TO_NEW_PROPERTY_BY_TYPES => [
|
2020-07-30 00:43:06 +02:00
|
|
|
'Illuminate\Database\Eloquent\Concerns\HasEvents' => [
|
|
|
|
'events' => 'dispatchesEvents',
|
|
|
|
],
|
|
|
|
'Illuminate\Database\Eloquent\Relations\Pivot' => [
|
|
|
|
'parent' => 'pivotParent',
|
|
|
|
],
|
2020-07-18 18:57:24 +02:00
|
|
|
],
|
2020-07-30 00:43:06 +02:00
|
|
|
]]);
|
2020-07-18 18:57:24 +02:00
|
|
|
|
|
|
|
$services->set(RenameClassRector::class)
|
2020-07-30 00:43:06 +02:00
|
|
|
->call(
|
|
|
|
'configure',
|
|
|
|
[[
|
2020-07-30 01:39:41 +02:00
|
|
|
RenameClassRector::OLD_TO_NEW_CLASSES => [
|
2020-07-30 00:43:06 +02:00
|
|
|
'Illuminate\Translation\LoaderInterface' => 'Illuminate\Contracts\Translation\Loader',
|
|
|
|
],
|
|
|
|
]]
|
2020-07-18 18:57:24 +02:00
|
|
|
);
|
|
|
|
};
|