mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 03:35:01 +01:00
* nette-30 config cleanup * [TypeDeclaratoin] Move AddReturnTypeDeclarationRector from generic * add Type support to AddReturnTypeDeclaration * make AddParamTypeDeclarationRector use PHPStan type objects over strings * [SymfonyPhpConfig] Add support for nested types * drop StringTypeToPhpParserNodeMapper * [ci-review] Rector Rectify Co-authored-by: rector-bot <tomas@getrector.org>
24 lines
885 B
PHP
24 lines
885 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use PHPStan\Type\ArrayType;
|
|
use PHPStan\Type\MixedType;
|
|
use function Rector\SymfonyPhpConfig\inline_value_objects;
|
|
use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
|
use Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration;
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
|
|
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 => inline_value_objects([
|
|
new AddReturnTypeDeclaration('PhpSpec\ObjectBehavior', 'getMatchers', $arrayType),
|
|
]),
|
|
]]);
|
|
};
|