mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 19:53:14 +01:00
2468277687
[TypeDeclaration] Handle infered ThisType on auto import on ReturnTypeDeclarationRector (#1760)
16 lines
886 B
PHP
16 lines
886 B
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace RectorPrefix20220202;
|
|
|
|
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;
|
|
return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void {
|
|
$services = $containerConfigurator->services();
|
|
$arrayType = new \PHPStan\Type\ArrayType(new \PHPStan\Type\MixedType(), new \PHPStan\Type\MixedType());
|
|
$services->set(\Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector::class)->configure([new \Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration('PhpSpec\\ObjectBehavior', 'getMatchers', $arrayType)]);
|
|
};
|