mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit 84a48e5e10be865e5fe6f0bbdcab3a7fc300a886
84a48e5e10
[tests] Use file paths over value objects in tests to improve performance (#2878)
This commit is contained in:
parent
6c20d257e3
commit
2518d99664
|
@ -13,17 +13,17 @@ final class RenameSimpleRectorTest extends AbstractRectorTestCase
|
|||
/**
|
||||
* @dataProvider provideData()
|
||||
*/
|
||||
public function test(SmartFileInfo $fileInfo): void
|
||||
public function test(string $filePath): void
|
||||
{
|
||||
$this->doTestFileInfo($fileInfo);
|
||||
$this->doTestFile($filePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Iterator<SmartFileInfo>
|
||||
* @return Iterator<array<string>>
|
||||
*/
|
||||
public function provideData(): Iterator
|
||||
{
|
||||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
return $this->yieldFilePathsFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
public function provideConfigFilePath(): string
|
||||
|
|
|
@ -79,13 +79,20 @@ abstract class AbstractRectorTestCase extends \Rector\Testing\PHPUnit\AbstractTe
|
|||
\gc_collect_cycles();
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
* @return Iterator<SmartFileInfo>
|
||||
* @deprecated Use \Rector\Testing\PHPUnit\AbstractRectorTestCase::yieldFilePathsFromDirectory() instead
|
||||
* @return Iterator<<SmartFileInfo>>
|
||||
*/
|
||||
protected function yieldFilesFromDirectory(string $directory, string $suffix = '*.php.inc') : Iterator
|
||||
{
|
||||
return FixtureFileFinder::yieldDirectory($directory, $suffix);
|
||||
}
|
||||
/**
|
||||
* @return Iterator<<string>>
|
||||
*/
|
||||
protected function yieldFilePathsFromDirectory(string $directory, string $suffix = '*.php.inc') : Iterator
|
||||
{
|
||||
return FixtureFileFinder::yieldFilePathsFromDirectory($directory, $suffix);
|
||||
}
|
||||
protected function isWindows() : bool
|
||||
{
|
||||
return \strncasecmp(\PHP_OS, 'WIN', 3) === 0;
|
||||
|
|
|
@ -48,7 +48,6 @@ final class FileProcessor
|
|||
public function parseFileInfoToLocalCache(File $file) : void
|
||||
{
|
||||
// store tokens by absolute path, so we don't have to print them right now
|
||||
// $smartFileInfo = $file->getSmartFileInfo();
|
||||
$stmtsAndTokens = $this->rectorParser->parseFileToStmtsAndTokens($file->getFilePath());
|
||||
$oldStmts = $stmtsAndTokens->getStmts();
|
||||
$oldTokens = $stmtsAndTokens->getTokens();
|
||||
|
|
|
@ -78,10 +78,10 @@ final class RemovedAndAddedFilesCollector
|
|||
return $addedFile instanceof AddedFileWithNodes;
|
||||
});
|
||||
}
|
||||
// public function getAffectedFilesCount(): int
|
||||
// {
|
||||
// return count($this->addedFiles) + count($this->removedFilePaths);
|
||||
// }
|
||||
public function getAffectedFilesCount() : int
|
||||
{
|
||||
return \count($this->addedFiles) + \count($this->removedFilePaths);
|
||||
}
|
||||
public function getAddedFileCount() : int
|
||||
{
|
||||
return \count($this->addedFiles);
|
||||
|
|
|
@ -17,12 +17,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'd3d18d442c8f2ca64f5ebef5c7a7541938fa1e2a';
|
||||
public const PACKAGE_VERSION = '84a48e5e10be865e5fe6f0bbdcab3a7fc300a886';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-09-01 11:26:12';
|
||||
public const RELEASE_DATE = '2022-09-01 11:33:11';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
|
@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInita4b58e9af83043ebf51c6db45c1515ce::getLoader();
|
||||
return ComposerAutoloaderInitd475eda4ba9d2c1ac7b979b14447154f::getLoader();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInita4b58e9af83043ebf51c6db45c1515ce
|
||||
class ComposerAutoloaderInitd475eda4ba9d2c1ac7b979b14447154f
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,19 +22,19 @@ class ComposerAutoloaderInita4b58e9af83043ebf51c6db45c1515ce
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInita4b58e9af83043ebf51c6db45c1515ce', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitd475eda4ba9d2c1ac7b979b14447154f', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInita4b58e9af83043ebf51c6db45c1515ce', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitd475eda4ba9d2c1ac7b979b14447154f', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInita4b58e9af83043ebf51c6db45c1515ce::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitd475eda4ba9d2c1ac7b979b14447154f::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInita4b58e9af83043ebf51c6db45c1515ce::$files;
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInitd475eda4ba9d2c1ac7b979b14447154f::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequirea4b58e9af83043ebf51c6db45c1515ce($fileIdentifier, $file);
|
||||
composerRequired475eda4ba9d2c1ac7b979b14447154f($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
|
@ -46,7 +46,7 @@ class ComposerAutoloaderInita4b58e9af83043ebf51c6db45c1515ce
|
|||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequirea4b58e9af83043ebf51c6db45c1515ce($fileIdentifier, $file)
|
||||
function composerRequired475eda4ba9d2c1ac7b979b14447154f($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInita4b58e9af83043ebf51c6db45c1515ce
|
||||
class ComposerStaticInitd475eda4ba9d2c1ac7b979b14447154f
|
||||
{
|
||||
public static $files = array (
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
|
@ -3139,9 +3139,9 @@ class ComposerStaticInita4b58e9af83043ebf51c6db45c1515ce
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInita4b58e9af83043ebf51c6db45c1515ce::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInita4b58e9af83043ebf51c6db45c1515ce::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInita4b58e9af83043ebf51c6db45c1515ce::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitd475eda4ba9d2c1ac7b979b14447154f::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitd475eda4ba9d2c1ac7b979b14447154f::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitd475eda4ba9d2c1ac7b979b14447154f::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
|
@ -1853,12 +1853,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-doctrine.git",
|
||||
"reference": "18e2ce933cfa71950db6afb1fff2212d26839f7b"
|
||||
"reference": "3ef708535ac9223b873e7002ced898bc8d2bf301"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/18e2ce933cfa71950db6afb1fff2212d26839f7b",
|
||||
"reference": "18e2ce933cfa71950db6afb1fff2212d26839f7b",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/3ef708535ac9223b873e7002ced898bc8d2bf301",
|
||||
"reference": "3ef708535ac9223b873e7002ced898bc8d2bf301",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1877,14 +1877,14 @@
|
|||
"rector\/phpstan-rules": "^0.6",
|
||||
"rector\/rector-debugging": "dev-main",
|
||||
"rector\/rector-generator": "^0.6.10",
|
||||
"rector\/rector-src": "dev-main#ef56c1d",
|
||||
"rector\/rector-src": "dev-main",
|
||||
"symplify\/easy-coding-standard": "^11.0",
|
||||
"symplify\/phpstan-extensions": "^11.1",
|
||||
"symplify\/phpstan-rules": "^11.1",
|
||||
"symplify\/rule-doc-generator": "^11.1",
|
||||
"symplify\/vendor-patches": "^11.1"
|
||||
},
|
||||
"time": "2022-09-01T09:21:32+00:00",
|
||||
"time": "2022-09-01T09:33:18+00:00",
|
||||
"default-branch": true,
|
||||
"type": "rector-extension",
|
||||
"extra": {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
|
|||
*/
|
||||
final class GeneratedConfig
|
||||
{
|
||||
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main dc14bb9'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 18e2ce9'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main e4306ff'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 1220d41'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main a0c7011'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 9ccb59f'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 1cb8fa7'));
|
||||
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main dc14bb9'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 3ef7085'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main e4306ff'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 1220d41'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main a0c7011'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 9ccb59f'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 1cb8fa7'));
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"symplify\/phpstan-extensions": "^11.1",
|
||||
"symplify\/easy-coding-standard": "^11.0",
|
||||
"symplify\/rule-doc-generator": "^11.1",
|
||||
"rector\/rector-src": "dev-main#ef56c1d",
|
||||
"rector\/rector-src": "dev-main",
|
||||
"doctrine\/orm": "^2.10",
|
||||
"phpstan\/phpstan-webmozart-assert": "^1.0",
|
||||
"phpstan\/phpstan-strict-rules": "^1.1",
|
||||
|
|
Loading…
Reference in New Issue