add e2e parse match on PHP 7.4

This commit is contained in:
Tomas Votruba 2021-12-13 21:16:45 +01:00
parent 4b35465629
commit 532362bfab
5 changed files with 72 additions and 25 deletions

32
.github/workflows/e2e_php74.yaml vendored Normal file
View File

@ -0,0 +1,32 @@
# This workflow runs system tests: Use the Rector application from the source
# checkout to process "fixture" projects in tests/system-tests
# to see if those can be processed successfully
name: End to End tests on PHP 7.4
on:
pull_request: null
push:
branches:
- main
jobs:
end_to_end_on_php74:
runs-on: ubuntu-latest
name: End to end test - PHP 7.4 and Match class name
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
coverage: none
-
run: composer install --ansi
working-directory: e2e/parse-match-class-on-php74
-
run: ../../bin/rector process --dry-run --ansi
working-directory: e2e/parse-match-class-on-php74

View File

@ -0,0 +1,11 @@
{
"require": {
"php": "7.4.*",
"ruflin/elastica": "6.1.5"
},
"autoload": {
"psr-4": {
"Foo\\": "src"
}
}
}

View File

@ -0,0 +1,14 @@
<?php
declare(strict_types=1);
use Rector\Core\Configuration\Option;
use Rector\Set\ValueObject\SetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::PATHS, [__DIR__.'/src']);
$containerConfigurator->import(SetList::DEAD_CODE);
};

View File

@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace Foo;
use Elastica\Query\MatchQuery;
final class QueryMatching
{
public function run()
{
$matchQuery = new MatchQuery();
}
}

View File

@ -1,25 +0,0 @@
<?php
declare (strict_types=1);
namespace RectorPrefix20210703;
use Rector\Arguments\Rector\MethodCall\ValueObjectWrapArgRector;
use Rector\Arguments\ValueObject\ValueObjectWrapArg;
use Rector\Renaming\Rector\ClassConstFetch\RenameClassConstFetchRector;
use Rector\Renaming\Rector\Name\RenameClassRector;
use Rector\Renaming\ValueObject\RenameClassAndConstFetch;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\SymfonyPhpConfig\ValueObjectInliner;
return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void {
$services = $containerConfigurator->services();
$services->set(\Rector\Arguments\Rector\MethodCall\ValueObjectWrapArgRector::class)->call('configure', [[\Rector\Arguments\Rector\MethodCall\ValueObjectWrapArgRector::VALUE_OBJECT_WRAP_ARGS => \Symplify\SymfonyPhpConfig\ValueObjectInliner::inline([new \Rector\Arguments\ValueObject\ValueObjectWrapArg('Rector\\NodeTypeResolver\\NodeTypeResolver', 'isMethodStaticCallOrClassMethodObjectType', 1, 'PHPStan\\Type\\ObjectType'), new \Rector\Arguments\ValueObject\ValueObjectWrapArg('Rector\\NodeTypeResolver\\NodeTypeResolver', 'isObjectType', 1, 'PHPStan\\Type\\ObjectType'), new \Rector\Arguments\ValueObject\ValueObjectWrapArg('Rector\\NodeTypeResolver\\NodeTypeResolver', 'isObjectTypes', 1, 'PHPStan\\Type\\ObjectType'), new \Rector\Arguments\ValueObject\ValueObjectWrapArg('Rector\\Core\\Rector\\AbstractRector', 'isObjectType', 1, 'PHPStan\\Type\\ObjectType')])]]);
$services->set(\Rector\Renaming\Rector\Name\RenameClassRector::class)->call('configure', [[
'Rector\\Core\\Console\\Command\\AbstractCommand' => 'Symfony\\Component\\Console\\Command\\Command',
'Rector\\Testing\\PHPUnit\\AbstractCommunityRectorTestCase' => 'Rector\\Testing\\PHPUnit\\AbstractRectorTestCase',
'Rector\\AttributeAwarePhpDoc\\Ast\\PhpDoc\\AttributeAwareParamTagValueNode' => 'Rector\\BetterPhpDocParser\\ValueObject\\PhpDoc\\VariadicAwareParamTagValueNode',
// @see https://github.com/rectorphp/rector/pull/5841
'Rector\\AttributeAwarePhpDoc\\Ast\\PhpDoc\\AttributeAwarePhpDocTagNode' => 'PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagNode',
'Rector\\AttributeAwarePhpDoc\\Ast\\Type\\AttributeAwareGenericTypeNode' => 'PHPStan\\PhpDocParser\\Ast\\Type\\GenericTypeNode',
]]);
$services->set(\Rector\Renaming\Rector\ClassConstFetch\RenameClassConstFetchRector::class)->call('configure', [[\Rector\Renaming\Rector\ClassConstFetch\RenameClassConstFetchRector::CLASS_CONSTANT_RENAME => \Symplify\SymfonyPhpConfig\ValueObjectInliner::inline([new \Rector\Renaming\ValueObject\RenameClassAndConstFetch('Rector\\PHPStanStaticTypeMapper\\PHPStanStaticTypeMapper', 'KIND_PARAM', 'Rector\\PHPStanStaticTypeMapper\\ValueObject\\TypeKind', 'KIND_PARAM')])]]);
};