mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-23 11:14:38 +01:00
* [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
24 lines
882 B
PHP
24 lines
882 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use PHPStan\Type\ArrayType;
|
|
use PHPStan\Type\MixedType;
|
|
use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
|
use Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration;
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
|
$services = $containerConfigurator->services();
|
|
|
|
$arrayType = new ArrayType(new MixedType(), new MixedType());
|
|
|
|
$services->set(AddReturnTypeDeclarationRector::class)
|
|
->call('configure', [[
|
|
AddReturnTypeDeclarationRector::METHOD_RETURN_TYPES => ValueObjectInliner::inline([
|
|
new AddReturnTypeDeclaration('PhpSpec\ObjectBehavior', 'getMatchers', $arrayType),
|
|
]),
|
|
]]);
|
|
};
|