[scoped on PHP 7.0] bin/rector run with extracted phpstan (#6371)

This commit is contained in:
Tomas Votruba 2021-05-06 23:43:45 +02:00 committed by GitHub
parent 4f8985a30f
commit d225be28d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 7 deletions

View File

@ -40,8 +40,15 @@ jobs:
# extra content of phpstan.phar to vendor/phpstan/phpstan-extracted
- run: php box.phar extract vendor/phpstan/phpstan/phpstan.phar vendor/phpstan/phpstan-extracted
# original phpstan/phpstan is now duplicated, we don't need it now
- run: composer remove phpstan/phpstan
# "composer remove phpstan/phpstan" original phpstan/phpstan is now duplicated, we don't need it now -required by phpstan extensions, cannot be removed like this
# to avoid double packing the same code
- run: rm -rf vendor/bin/phpstan
- run: rm -rf vendor/phpstan/phpstan/phpstan.phar
- run: rm phpstan-for-rector.neon
# THIS MUST WORK
- run: bin/rector downgrade-paths
# 1. copy files to $NESTED_DIRECTORY directory Exclude the scoped/nested directories to prevent rsync from copying in a loop
- run: rsync --exclude rector-build-php70 -av * rector-build-php70 --quiet

View File

@ -25,7 +25,12 @@ define('__RECTOR_RUNNING__', true);
$autoloadIncluder = new AutoloadIncluder();
$autoloadIncluder->includeDependencyOrRepositoryVendorAutoloadIfExists();
if (should_include_preload()) {
// load extracted PHPStan with its own preload.php
$extractedPhpstanAutoload = __DIR__ . '/../vendor/phpstan/phpstan-extracted/vendor/autoload.php';
if (file_exists($extractedPhpstanAutoload)) {
require_once $extractedPhpstanAutoload;
} elseif (should_include_preload()) {
require_once __DIR__ . '/../preload.php';
}

View File

@ -25,7 +25,7 @@
"phpstan/phpstan-phpunit": "^0.12.18",
"rector/rector-cakephp": "^0.10.4",
"rector/rector-doctrine": "^0.10.6",
"rector/rector-installer": "^0.10.1",
"rector/extension-installer": "^0.10.2",
"rector/rector-laravel": "^0.10.2",
"rector/rector-nette": "^0.10.9",
"rector/rector-nette-to-symfony": "^0.10.0",

View File

@ -488,3 +488,5 @@ parameters:
paths:
- rules/EarlyReturn/Rector/If_/ChangeNestedIfsToEarlyReturnRector.php
- rules/EarlyReturn/Rector/If_/ChangeAndIfToEarlyReturnRector.php
- '#Class with base "PhpVersionFactory" name is already used in "PHPStan\\Php\\PhpVersionFactory", "Rector\\Core\\Util\\PhpVersionFactory"\. Use unique name to make classes easy to recognize#'

View File

@ -23,9 +23,6 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
use Symplify\SymfonyPhpConfig\ValueObjectInliner;
return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::SETS, [SetList::NAMING]);
// include sets
$containerConfigurator->import(SetList::CODING_STYLE);
$containerConfigurator->import(SetList::CODE_QUALITY);