Updated Rector to commit daf8b4879cbd0c4a0f42691b81b8d0c7f63da855

daf8b4879c Revert broken load Phar support on BootstrapFilesIncluder (#5529)
This commit is contained in:
Tomas Votruba 2024-01-30 22:49:21 +00:00
parent 97c24103e6
commit 4d9655bcf0
2 changed files with 5 additions and 18 deletions

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '6046c24443d9bfdfe5bf8638fb82e03703ee1df8';
public const PACKAGE_VERSION = 'daf8b4879cbd0c4a0f42691b81b8d0c7f63da855';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-01-31 03:46:18';
public const RELEASE_DATE = '2024-01-30 22:47:15';
/**
* @var int
*/

View File

@ -4,7 +4,6 @@ declare (strict_types=1);
namespace Rector\Autoloading;
use FilesystemIterator;
use Phar;
use Rector\Configuration\Option;
use Rector\Configuration\Parameter\SimpleParameterProvider;
use Rector\Exception\ShouldNotHappenException;
@ -31,19 +30,11 @@ final class BootstrapFilesIncluder
if (!\is_file($bootstrapFile)) {
throw new ShouldNotHappenException(\sprintf('Bootstrap file "%s" does not exist.', $bootstrapFile));
}
// 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($isLoadPHPUnitPhar);
$this->requireRectorStubs();
}
private function requireRectorStubs(bool $isLoadPHPUnitPhar) : void
private function requireRectorStubs() : void
{
/** @var false|string $stubsRectorDirectory */
$stubsRectorDirectory = \realpath(__DIR__ . '/../../stubs-rector');
@ -54,11 +45,7 @@ final class BootstrapFilesIncluder
/** @var SplFileInfo[] $stubs */
$stubs = new RecursiveIteratorIterator($dir);
foreach ($stubs as $stub) {
$realPath = $stub->getRealPath();
if ($isLoadPHPUnitPhar && \substr_compare($realPath, 'TestCase.php', -\strlen('TestCase.php')) === 0) {
continue;
}
require_once $realPath;
require_once $stub->getRealPath();
}
}
}