2020-07-18 18:57:24 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-10-30 12:58:35 +01:00
|
|
|
use PHPStan\Type\ArrayType;
|
|
|
|
use PHPStan\Type\MixedType;
|
|
|
|
use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
|
|
|
use Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration;
|
2020-07-18 18:57:24 +02:00
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
2020-11-26 17:44:27 +01:00
|
|
|
use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
2020-07-18 18:57:24 +02:00
|
|
|
|
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
|
|
|
$services = $containerConfigurator->services();
|
|
|
|
|
2020-10-30 12:58:35 +01:00
|
|
|
$arrayType = new ArrayType(new MixedType(), new MixedType());
|
|
|
|
|
2020-07-18 18:57:24 +02:00
|
|
|
$services->set(AddReturnTypeDeclarationRector::class)
|
2020-07-30 00:43:06 +02:00
|
|
|
->call('configure', [[
|
2020-11-26 17:44:27 +01:00
|
|
|
AddReturnTypeDeclarationRector::METHOD_RETURN_TYPES => ValueObjectInliner::inline([
|
2020-10-30 12:58:35 +01:00
|
|
|
new AddReturnTypeDeclaration('PhpSpec\ObjectBehavior', 'getMatchers', $arrayType),
|
2020-08-25 20:34:49 +02:00
|
|
|
]),
|
2020-07-30 00:43:06 +02:00
|
|
|
]]);
|
2020-07-18 18:57:24 +02:00
|
|
|
};
|