mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-12 11:30:31 +01:00
28 lines
1.1 KiB
PHP
28 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Rector\PHPUnit\Rector\ClassMethod\ExceptionAnnotationRector;
|
|
use Rector\PHPUnit\Rector\MethodCall\DelegateExceptionArgumentsRector;
|
|
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
|
use Rector\Renaming\ValueObject\MethodCallRename;
|
|
use function Rector\SymfonyPhpConfig\inline_value_objects;
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
|
$services = $containerConfigurator->services();
|
|
|
|
# handles 2nd and 3rd argument of setExpectedException
|
|
$services->set(DelegateExceptionArgumentsRector::class);
|
|
|
|
$services->set(ExceptionAnnotationRector::class);
|
|
|
|
$services->set(RenameMethodRector::class)
|
|
->call('configure', [[
|
|
RenameMethodRector::METHOD_CALL_RENAMES => inline_value_objects([
|
|
new MethodCallRename('PHPUnit\Framework\TestClass', 'setExpectedException', 'expectedException'),
|
|
new MethodCallRename('PHPUnit\Framework\TestClass', 'setExpectedExceptionRegExp', 'expectedException'),
|
|
]),
|
|
]]);
|
|
};
|