mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 22:08:00 +01:00
Updated Rector to commit f680a070335ee796de19b25a98c2d4ac172b6fe8
f680a07033
[Autoloading] Proper fix for fix bootstrap phpunit.phar (#5522)
This commit is contained in:
parent
8fe9717aee
commit
0301d3f400
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '3c51cd8ebebd6840a0374e367308049c36761ee0';
|
||||
public const PACKAGE_VERSION = 'f680a070335ee796de19b25a98c2d4ac172b6fe8';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-01-30 16:00:02';
|
||||
public const RELEASE_DATE = '2024-01-30 10:06:09';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -25,6 +25,7 @@ final class BootstrapFilesIncluder
|
||||
{
|
||||
$bootstrapFiles = SimpleParameterProvider::provideArrayParameter(Option::BOOTSTRAP_FILES);
|
||||
Assert::allString($bootstrapFiles);
|
||||
$isLoadPHPUnitPhar = \false;
|
||||
/** @var string[] $bootstrapFiles */
|
||||
foreach ($bootstrapFiles as $bootstrapFile) {
|
||||
if (!\is_file($bootstrapFile)) {
|
||||
@ -33,13 +34,16 @@ final class BootstrapFilesIncluder
|
||||
// load phar file
|
||||
if (\substr_compare($bootstrapFile, '.phar', -\strlen('.phar')) === 0) {
|
||||
Phar::loadPhar($bootstrapFile);
|
||||
if (\substr_compare($bootstrapFile, 'phpunit.phar', -\strlen('phpunit.phar')) === 0) {
|
||||
$isLoadPHPUnitPhar = \true;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
require $bootstrapFile;
|
||||
}
|
||||
$this->requireRectorStubs();
|
||||
$this->requireRectorStubs($isLoadPHPUnitPhar);
|
||||
}
|
||||
private function requireRectorStubs() : void
|
||||
private function requireRectorStubs(bool $isLoadPHPUnitPhar) : void
|
||||
{
|
||||
/** @var false|string $stubsRectorDirectory */
|
||||
$stubsRectorDirectory = \realpath(__DIR__ . '/../../stubs-rector');
|
||||
@ -50,7 +54,11 @@ final class BootstrapFilesIncluder
|
||||
/** @var SplFileInfo[] $stubs */
|
||||
$stubs = new RecursiveIteratorIterator($dir);
|
||||
foreach ($stubs as $stub) {
|
||||
require_once $stub->getRealPath();
|
||||
$realPath = $stub->getRealPath();
|
||||
if ($isLoadPHPUnitPhar && \substr_compare($realPath, 'TestCase.php', -\strlen('TestCase.php')) === 0) {
|
||||
continue;
|
||||
}
|
||||
require_once $realPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user