mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 11:44:14 +01:00
* [DoctrineCodeQuality] Fix oveCurrentDateTimeDefaultInEntityToConstructorRector for default value * re-use local property method * improve new_ nesting * [rector] improve new_ nesting * static fixes * bump deps Co-authored-by: rector-bot <tomas@getrector.org>
Symfony PHP Config
Tools that easy work with Symfony PHP Configs.
Read How to Inline Value Object in Symfony PHP Config to learn more.TagValueNodeReprintTest
1. Install
composer require rector/symfony-php-config
2. Usage
Do you want to use value objects in Symfony configs?
Use Rector\SymfonyPhpConfig\inline_value_objects
function:
<?php
declare(strict_types=1);
use function Rector\SymfonyPhpConfig\inline_value_objects;
use Rector\Generic\Rector\FuncCall\FuncCallToStaticCallRector;
use Rector\Transform\ValueObject\FuncCallToStaticCall;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(FuncCallToStaticCallRector::class)
->call('configure', [[
FuncCallToStaticCallRector::FUNC_CALLS_TO_STATIC_CALLS => inline_value_objects([
new FuncCallToStaticCall('dump', 'Tracy\Debugger', 'dump'),
// it handles multiple items without duplicated call
new FuncCallToStaticCall('d', 'Tracy\Debugger', 'dump'),
new FuncCallToStaticCall('dd', 'Tracy\Debugger', 'dump'),
])
]]);
};