rector/config/set/laravel58.php

44 lines
1.6 KiB
PHP
Raw Normal View History

2020-07-18 18:57:24 +02:00
<?php
declare(strict_types=1);
use Rector\Generic\Rector\ClassMethod\AddReturnTypeDeclarationRector;
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)
->call('configure', [[
2020-07-30 01:39:41 +02:00
AddReturnTypeDeclarationRector::TYPEHINT_FOR_METHOD_BY_CLASS => [
'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-18 18:57:24 +02:00
$services->set(RenamePropertyRector::class)
->call('configure', [[
2020-07-30 01:39:41 +02:00
RenamePropertyRector::OLD_TO_NEW_PROPERTY_BY_TYPES => [
'Illuminate\Routing\UrlGenerator' => [
'cachedSchema' => 'cachedScheme',
],
2020-07-18 18:57:24 +02:00
],
]]);
2020-07-18 18:57:24 +02:00
};