2020-07-18 18:57:24 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-07-29 01:41:20 +02:00
|
|
|
use Rector\Generic\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
2020-08-18 17:57:30 +02:00
|
|
|
use Rector\Generic\Rector\PropertyFetch\RenamePropertyRector;
|
2020-07-18 18:57:24 +02:00
|
|
|
use Rector\Laravel\Rector\StaticCall\MinutesToSecondsInCacheRector;
|
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
|
|
|
2020-07-18 19:00:36 +02:00
|
|
|
# https://laravel-news.com/laravel-5-8-deprecates-string-and-array-helpers
|
|
|
|
# https://github.com/laravel/framework/pull/26898
|
|
|
|
# see: https://laravel.com/docs/5.8/upgrade
|
2020-07-18 18:57:24 +02:00
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
2020-07-21 10:02:50 +02:00
|
|
|
$containerConfigurator->import(__DIR__ . '/laravel-array-str-functions-to-static-call.php');
|
2020-07-18 18:57:24 +02:00
|
|
|
|
|
|
|
$services = $containerConfigurator->services();
|
|
|
|
|
|
|
|
$services->set(MinutesToSecondsInCacheRector::class);
|
|
|
|
|
|
|
|
$services->set(AddReturnTypeDeclarationRector::class)
|
2020-07-30 00:43:06 +02:00
|
|
|
->call('configure', [[
|
2020-07-30 01:39:41 +02:00
|
|
|
AddReturnTypeDeclarationRector::TYPEHINT_FOR_METHOD_BY_CLASS => [
|
2020-07-30 00:43:06 +02:00
|
|
|
'Illuminate\Contracts\Cache\Repository' => [
|
|
|
|
'put' => 'bool',
|
|
|
|
'forever' => 'bool',
|
|
|
|
],
|
|
|
|
'Illuminate\Contracts\Cache\Store' => [
|
|
|
|
'put' => 'bool',
|
|
|
|
'putMany' => 'bool',
|
|
|
|
'forever' => 'bool',
|
|
|
|
],
|
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(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\Routing\UrlGenerator' => [
|
|
|
|
'cachedSchema' => 'cachedScheme',
|
|
|
|
],
|
2020-07-18 18:57:24 +02:00
|
|
|
],
|
2020-07-30 00:43:06 +02:00
|
|
|
]]);
|
2020-07-18 18:57:24 +02:00
|
|
|
};
|