mirror of https://github.com/rectorphp/rector.git
Fixing build (#25)
This commit is contained in:
parent
71a8faedf0
commit
ac302b5284
|
@ -9,6 +9,9 @@ on:
|
|||
tags:
|
||||
- '*'
|
||||
|
||||
# to debug
|
||||
pull_request: null
|
||||
|
||||
env:
|
||||
# see https://github.com/composer/composer/issues/9368#issuecomment-718112361
|
||||
COMPOSER_ROOT_VERSION: "dev-main"
|
||||
|
|
|
@ -11,18 +11,12 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
$phpStanStubLoader = new PHPStanStubLoader();
|
||||
$phpStanStubLoader->loadStubs();
|
||||
|
||||
require_once __DIR__ . '/../../stubs-rector/PHPUnit/Framework/TestCase.php';
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$parameters = $containerConfigurator->parameters();
|
||||
|
||||
$skip = array_merge(
|
||||
DowngradeRectorConfig::DEPENDENCY_EXCLUDE_PATHS,
|
||||
[
|
||||
// should be skipped until phpstan is downgraded to avoid conflict like this https://github.com/rectorphp/rector-prefixed/runs/2422176105#step:4:4
|
||||
DowngradeNullableTypeDeclarationRector::class
|
||||
]
|
||||
);
|
||||
$parameters->set(Option::SKIP, $skip);
|
||||
|
||||
$parameters->set(Option::SKIP, DowngradeRectorConfig::DEPENDENCY_EXCLUDE_PATHS);
|
||||
$parameters->set(Option::PHPSTAN_FOR_RECTOR_PATH, __DIR__ . '/phpstan-for-downgrade.neon');
|
||||
|
||||
$containerConfigurator->import(DowngradeSetList::PHP_80);
|
||||
|
@ -44,10 +38,6 @@ final class DowngradeRectorConfig
|
|||
// symfony test are parts of package
|
||||
'*/Test/*',
|
||||
|
||||
// missing phpunit test case
|
||||
'packages/Testing/PHPUnit/AbstractRectorTestCase.php',
|
||||
'packages/Testing/PHPUnit/AbstractComposerRectorTestCase.php',
|
||||
|
||||
// only for dev
|
||||
'packages/Testing/PhpConfigPrinter/*',
|
||||
|
||||
|
|
|
@ -36,3 +36,8 @@ for directory in $directories; do
|
|||
# --working-dir is needed, so "SKIP" parameter is applied in absolute path of nested directory
|
||||
php -d memory_limit=-1 bin/rector process $directory --config build/config/config-downgrade.php --working-dir $BUILD_DIRECTORY --ansi
|
||||
done
|
||||
|
||||
|
||||
# CONFIRMED: give time to print all the files, before the next process takes over newly printed content
|
||||
# avoids bugs like these half of files done, next half waiting https://github.com/rectorphp/rector-src/runs/2565478682
|
||||
sleep 20
|
||||
|
|
|
@ -9,7 +9,6 @@ use Symfony\Component\Finder\Finder;
|
|||
use Symfony\Component\Finder\SplFileInfo;
|
||||
use Symplify\Skipper\SkipCriteriaResolver\SkippedPathsResolver;
|
||||
use Symplify\SmartFileSystem\FileSystemFilter;
|
||||
use Symplify\SmartFileSystem\FileSystemGuard;
|
||||
use Symplify\SmartFileSystem\Finder\FinderSanitizer;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ final class FilesystemTweaker
|
|||
foreach ($directories as $directory) {
|
||||
// is fnmatch for directories
|
||||
if (Strings::contains($directory, '*')) {
|
||||
$foundDirectories = $this->foundDirectoriesInGlob($directory);
|
||||
$foundDirectories = $this->findDirectoriesInGlob($directory);
|
||||
$absoluteDirectories = array_merge($absoluteDirectories, $foundDirectories);
|
||||
} else {
|
||||
// is classic directory
|
||||
|
@ -38,24 +38,6 @@ final class FilesystemTweaker
|
|||
return $absoluteDirectories;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
private function foundDirectoriesInGlob(string $directory): array
|
||||
{
|
||||
$foundDirectories = [];
|
||||
|
||||
foreach ((array) glob($directory, GLOB_ONLYDIR) as $foundDirectory) {
|
||||
if (! is_string($foundDirectory)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$foundDirectories[] = $foundDirectory;
|
||||
}
|
||||
|
||||
return $foundDirectories;
|
||||
}
|
||||
|
||||
/**
|
||||
* This will turn paths like "src/Symfony/Component/*\/Tests" to existing directory paths
|
||||
*
|
||||
|
@ -78,6 +60,24 @@ final class FilesystemTweaker
|
|||
return $absolutePathsFound;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
private function findDirectoriesInGlob(string $directory): array
|
||||
{
|
||||
$foundDirectories = [];
|
||||
|
||||
foreach ((array) glob($directory, GLOB_ONLYDIR) as $foundDirectory) {
|
||||
if (! is_string($foundDirectory)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$foundDirectories[] = $foundDirectory;
|
||||
}
|
||||
|
||||
return $foundDirectories;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
if (class_exists('PHPUnit\Framework\TestCase')) {
|
||||
return;
|
||||
}
|
||||
|
||||
abstract class TestCase
|
||||
{
|
||||
}
|
Loading…
Reference in New Issue