2020-07-18 18:57:24 +02:00
|
|
|
<?php
|
|
|
|
|
2021-05-09 20:15:43 +00:00
|
|
|
declare (strict_types=1);
|
2021-05-10 00:23:30 +00:00
|
|
|
namespace RectorPrefix20210510;
|
2020-07-18 18:57:24 +02:00
|
|
|
|
2020-10-14 06:24:29 +02:00
|
|
|
use Rector\Defluent\Rector\MethodCall\FluentChainMethodCallToNormalMethodCallRector;
|
2020-07-18 18:57:24 +02:00
|
|
|
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
2020-08-25 00:26:14 +02:00
|
|
|
use Rector\Renaming\ValueObject\MethodCallRename;
|
2020-08-30 19:59:59 +02:00
|
|
|
use Rector\Transform\Rector\FuncCall\FuncCallToMethodCallRector;
|
2020-08-30 20:48:37 +02:00
|
|
|
use Rector\Transform\Rector\StaticCall\StaticCallToFuncCallRector;
|
2021-02-09 15:02:29 +01:00
|
|
|
use Rector\Transform\ValueObject\FuncCallToMethodCall;
|
2020-08-30 20:48:37 +02:00
|
|
|
use Rector\Transform\ValueObject\StaticCallToFuncCall;
|
2021-05-10 00:23:30 +00:00
|
|
|
use RectorPrefix20210510\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
2020-11-26 17:44:27 +01:00
|
|
|
use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
2021-05-10 22:10:16 +00:00
|
|
|
return static function (ContainerConfigurator $containerConfigurator) : void {
|
2020-07-18 18:57:24 +02:00
|
|
|
$services = $containerConfigurator->services();
|
|
|
|
# both uses "%classes_to_defluent%
|
2021-05-10 22:10:16 +00:00
|
|
|
$services->set(FluentChainMethodCallToNormalMethodCallRector::class);
|
|
|
|
$configuration = [new FuncCallToMethodCall('GuzzleHttp\\json_decode', 'GuzzleHttp\\Utils', 'jsonDecode'), new FuncCallToMethodCall('GuzzleHttp\\get_path', 'GuzzleHttp\\Utils', 'getPath')];
|
|
|
|
$services->set(FuncCallToMethodCallRector::class)->call('configure', [[FuncCallToMethodCallRector::FUNC_CALL_TO_CLASS_METHOD_CALL => ValueObjectInliner::inline($configuration)]]);
|
|
|
|
$services->set(StaticCallToFuncCallRector::class)->call('configure', [[StaticCallToFuncCallRector::STATIC_CALLS_TO_FUNCTIONS => ValueObjectInliner::inline([new StaticCallToFuncCall('GuzzleHttp\\Utils', 'setPath', 'GuzzleHttp\\set_path'), new StaticCallToFuncCall('GuzzleHttp\\Pool', 'batch', 'GuzzleHttp\\Pool\\batch')])]]);
|
|
|
|
$services->set(RenameMethodRector::class)->call('configure', [[RenameMethodRector::METHOD_CALL_RENAMES => ValueObjectInliner::inline([new MethodCallRename('GuzzleHttp\\Message\\MessageInterface', 'getHeaderLines', 'getHeaderAsArray')])]]);
|
2020-07-18 18:57:24 +02:00
|
|
|
};
|