Skip to content

Commit

Permalink
Updated Rector to commit 84a48e5e10be865e5fe6f0bbdcab3a7fc300a886
Browse files Browse the repository at this point in the history
rectorphp/rector-src@84a48e5 [tests] Use file paths over value objects in tests to improve performance (rectorphp#2878)
  • Loading branch information
TomasVotruba committed Sep 1, 2022
1 parent 6c20d25 commit 2518d99
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions packages/Testing/PHPUnit/AbstractRectorTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,20 @@ protected function tearDown() : void
\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;
Expand Down
1 change: 0 additions & 1 deletion src/Application/FileProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public function __construct(AffectedFilesCollector $affectedFilesCollector, Node
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();
Expand Down
8 changes: 4 additions & 4 deletions src/Application/FileSystem/RemovedAndAddedFilesCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ public function getAddedFilesWithNodes() : array
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);
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInita4b58e9af83043ebf51c6db45c1515ce::getLoader();
return ComposerAutoloaderInitd475eda4ba9d2c1ac7b979b14447154f::getLoader();
14 changes: 7 additions & 7 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInita4b58e9af83043ebf51c6db45c1515ce
class ComposerAutoloaderInitd475eda4ba9d2c1ac7b979b14447154f
{
private static $loader;

Expand All @@ -22,19 +22,19 @@ public static function getLoader()
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;
Expand All @@ -46,7 +46,7 @@ public static function getLoader()
* @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;
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInita4b58e9af83043ebf51c6db45c1515ce
class ComposerStaticInitd475eda4ba9d2c1ac7b979b14447154f
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
Expand Down Expand Up @@ -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);
}
Expand Down
10 changes: 5 additions & 5 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down
Loading

0 comments on commit 2518d99

Please sign in to comment.