rector/config/set/twig127.php
Tomas Votruba 0993088cda
[SymfonyPhpConfig] Use Symplify package instead + simplify set validation (#4694)
* [SymfonyPhpConfig] Use Symplify package instead

* [SymfonyPhpConfig] Drop forgotten custom-jobs Rectors

* [CI] simplify set validation

* from inline functions to Static class

* cleanup

* decouple rector.php to allow static analysis and coding standards
2020-11-26 16:44:27 +00:00

24 lines
1.0 KiB
PHP

<?php
declare(strict_types=1);
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\ValueObject\MethodCallRename;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\SymfonyPhpConfig\ValueObjectInliner;
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(RenameMethodRector::class)
->call('configure', [[
RenameMethodRector::METHOD_CALL_RENAMES => ValueObjectInliner::inline([
new MethodCallRename('Twig_Node', 'getLine', 'getTemplateLine'),
new MethodCallRename('Twig_Node', 'getFilename', 'getTemplateName'),
new MethodCallRename('Twig_Template', 'getSource', 'getSourceContext'),
new MethodCallRename('Twig_Error', 'getTemplateFile', 'getTemplateName'),
new MethodCallRename('Twig_Error', 'getTemplateName', 'setTemplateName'),
]),
]]);
};