2020-07-18 18:57:24 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-10-30 12:58:35 +01:00
|
|
|
use PHPStan\Type\BooleanType;
|
2020-11-18 01:22:40 +00:00
|
|
|
use Rector\Laravel\Rector\Class_\PropertyDeferToDeferrableProviderToRector;
|
|
|
|
use Rector\Laravel\Rector\New_\MakeTaggedPassedToParameterIterableTypeRector;
|
2020-07-18 18:57:24 +02:00
|
|
|
use Rector\Laravel\Rector\StaticCall\MinutesToSecondsInCacheRector;
|
2020-09-27 23:33:32 +02:00
|
|
|
use Rector\Renaming\Rector\PropertyFetch\RenamePropertyRector;
|
|
|
|
use Rector\Renaming\ValueObject\RenameProperty;
|
2020-08-25 20:34:49 +02:00
|
|
|
use function Rector\SymfonyPhpConfig\inline_value_objects;
|
2020-10-30 12:58:35 +01:00
|
|
|
use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
|
|
|
use Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration;
|
2020-07-18 18:57:24 +02:00
|
|
|
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);
|
2020-11-18 01:22:40 +00:00
|
|
|
$services->set(AddReturnTypeDeclarationRector::class)->call('configure', [[
|
|
|
|
AddReturnTypeDeclarationRector::METHOD_RETURN_TYPES => inline_value_objects([
|
|
|
|
new AddReturnTypeDeclaration('Illuminate\Contracts\Cache\Repository', 'put', new BooleanType()),
|
|
|
|
new AddReturnTypeDeclaration('Illuminate\Contracts\Cache\Repository', 'forever', new BooleanType()),
|
|
|
|
new AddReturnTypeDeclaration('Illuminate\Contracts\Cache\Store', 'put', new BooleanType()),
|
|
|
|
new AddReturnTypeDeclaration('Illuminate\Contracts\Cache\Store', 'putMany', new BooleanType()),
|
|
|
|
new AddReturnTypeDeclaration('Illuminate\Contracts\Cache\Store', 'forever', new BooleanType()),
|
|
|
|
]),
|
|
|
|
]]);
|
|
|
|
$services->set(RenamePropertyRector::class)->call('configure', [[
|
|
|
|
RenamePropertyRector::RENAMED_PROPERTIES => inline_value_objects([
|
|
|
|
new RenameProperty('Illuminate\Routing\UrlGenerator', 'cachedSchema', 'cachedScheme'),
|
|
|
|
]),
|
|
|
|
]]);
|
|
|
|
$services->set(PropertyDeferToDeferrableProviderToRector::class);
|
|
|
|
$services->set(MakeTaggedPassedToParameterIterableTypeRector::class);
|
2020-07-18 18:57:24 +02:00
|
|
|
};
|