rector/config/set/phpspec40.php

24 lines
882 B
PHP
Raw Normal View History

2020-07-18 18:57:24 +02:00
<?php
declare(strict_types=1);
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;
use Symplify\SymfonyPhpConfig\ValueObjectInliner;
2020-07-18 18:57:24 +02:00
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$arrayType = new ArrayType(new MixedType(), new MixedType());
2020-07-18 18:57:24 +02:00
$services->set(AddReturnTypeDeclarationRector::class)
->call('configure', [[
AddReturnTypeDeclarationRector::METHOD_RETURN_TYPES => ValueObjectInliner::inline([
new AddReturnTypeDeclaration('PhpSpec\ObjectBehavior', 'getMatchers', $arrayType),
]),
]]);
2020-07-18 18:57:24 +02:00
};