rector/config/set/defluent.php
Tomas Votruba 8af70b5ac0
[Defluent] Refactoring to multiple rules (#4400)
* [Defluent] Refactoring to multiple rules

* [Defluent] Decouple defluent-only set, it deserved to have own domain

* cleanup

* [rector] cleanup

* [cs] cleanup

* fixup! cleanup

* static fixes

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-14 04:24:29 +00:00

34 lines
1.6 KiB
PHP

<?php
declare(strict_types=1);
use Rector\Defluent\Rector\ClassMethod\ReturnThisRemoveRector;
use Rector\Defluent\Rector\MethodCall\FluentChainMethodCallToNormalMethodCallRector;
use Rector\Defluent\Rector\MethodCall\InArgFluentChainMethodCallToStandaloneMethodCallRector;
use Rector\Defluent\Rector\MethodCall\MethodCallOnSetterMethodCallToStandaloneAssignRector;
use Rector\Defluent\Rector\MethodCall\NewFluentChainMethodCallToNonFluentRector;
use Rector\Defluent\Rector\Return_\DefluentReturnMethodCallRector;
use Rector\Defluent\Rector\Return_\ReturnFluentChainMethodCallToNormalMethodCallRector;
use Rector\Defluent\Rector\Return_\ReturnNewFluentChainMethodCallToNonFluentRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
// @see https://ocramius.github.io/blog/fluent-interfaces-are-evil/
// @see https://www.yegor256.com/2018/03/13/fluent-interfaces.html
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
// variable/property
$services->set(FluentChainMethodCallToNormalMethodCallRector::class);
$services->set(ReturnFluentChainMethodCallToNormalMethodCallRector::class);
// new
$services->set(NewFluentChainMethodCallToNonFluentRector::class);
$services->set(ReturnNewFluentChainMethodCallToNonFluentRector::class);
$services->set(ReturnThisRemoveRector::class);
$services->set(DefluentReturnMethodCallRector::class);
$services->set(MethodCallOnSetterMethodCallToStandaloneAssignRector::class);
$services->set(InArgFluentChainMethodCallToStandaloneMethodCallRector::class);
};