Updated Rector to commit dc22a952fe92e3574a27c8e9e7de3d9aead42a4f

dc22a952fe [Scoped] Clean up SmartFileInfo (#2889)
This commit is contained in:
Tomas Votruba 2022-09-01 22:05:56 +00:00
parent 6d11119b51
commit 277e853737
14 changed files with 29 additions and 61 deletions

View File

@ -23,12 +23,4 @@ spl_autoload_register(function (string $class): void {
$composerAutoloader->loadClass($class); $composerAutoloader->loadClass($class);
} }
} }
// @deprecated, to be removed
if ($class === 'Symplify\SmartFileSystem\SmartFileInfo') {
$filePath = __DIR__ . '/vendor/symplify/smart-file-system/src/SmartFileInfo.php';
if (file_exists($filePath)) {
require_once $filePath;
}
}
}); });

View File

@ -6,7 +6,6 @@ namespace Rector\Testing\Fixture;
use Iterator; use Iterator;
use RectorPrefix202209\Symfony\Component\Finder\Finder; use RectorPrefix202209\Symfony\Component\Finder\Finder;
use RectorPrefix202209\Symfony\Component\Finder\SplFileInfo; use RectorPrefix202209\Symfony\Component\Finder\SplFileInfo;
use Symplify\SmartFileSystem\SmartFileInfo;
final class FixtureFileFinder final class FixtureFileFinder
{ {
/** /**
@ -19,18 +18,6 @@ final class FixtureFileFinder
(yield [$fileInfo->getRealPath()]); (yield [$fileInfo->getRealPath()]);
} }
} }
/**
* @deprecated
*/
public static function yieldDirectory(string $directory, string $suffix = '*.php.inc') : Iterator
{
$fileInfos = self::findFilesInDirectory($directory, $suffix);
foreach ($fileInfos as $fileInfo) {
// @todo is this one needed? maybe symfony is good enough :)
$smartFileInfo = new SmartFileInfo($fileInfo->getRealPath());
(yield [$smartFileInfo]);
}
}
/** /**
* @return SplFileInfo[] * @return SplFileInfo[]
*/ */

View File

@ -24,7 +24,6 @@ use Rector\Testing\Fixture\FixtureFileUpdater;
use Rector\Testing\Fixture\FixtureSplitter; use Rector\Testing\Fixture\FixtureSplitter;
use Rector\Testing\Fixture\FixtureTempFileDumper; use Rector\Testing\Fixture\FixtureTempFileDumper;
use Rector\Testing\PHPUnit\Behavior\MovingFilesTrait; use Rector\Testing\PHPUnit\Behavior\MovingFilesTrait;
use Symplify\SmartFileSystem\SmartFileInfo;
abstract class AbstractRectorTestCase extends \Rector\Testing\PHPUnit\AbstractTestCase implements RectorTestInterface abstract class AbstractRectorTestCase extends \Rector\Testing\PHPUnit\AbstractTestCase implements RectorTestInterface
{ {
use MovingFilesTrait; use MovingFilesTrait;
@ -113,14 +112,6 @@ abstract class AbstractRectorTestCase extends \Rector\Testing\PHPUnit\AbstractTe
$this->originalTempFilePath = $inputFilePath; $this->originalTempFilePath = $inputFilePath;
$this->doTestFileMatchesExpectedContent($inputFilePath, $expectedFilePath, $fixtureFilePath); $this->doTestFileMatchesExpectedContent($inputFilePath, $expectedFilePath, $fixtureFilePath);
} }
/**
* @deprecated Use doTestFile() with file path instead
*/
protected function doTestFileInfo(SmartFileInfo $fixtureFileInfo) : void
{
$fixtureFileRealPath = $fixtureFileInfo->getRealPath();
$this->doTestFile($fixtureFileRealPath);
}
protected function getFixtureTempDirectory() : string protected function getFixtureTempDirectory() : string
{ {
return FixtureTempFileDumper::getTempDirectory(); return FixtureTempFileDumper::getTempDirectory();

View File

@ -17,12 +17,12 @@ final class VersionResolver
* @api * @api
* @var string * @var string
*/ */
public const PACKAGE_VERSION = '2c454d292b8af3a8e8eb61f813efe6b12c66ae81'; public const PACKAGE_VERSION = 'dc22a952fe92e3574a27c8e9e7de3d9aead42a4f';
/** /**
* @api * @api
* @var string * @var string
*/ */
public const RELEASE_DATE = '2022-09-01 23:01:02'; public const RELEASE_DATE = '2022-09-02 05:01:35';
/** /**
* @var int * @var int
*/ */

2
vendor/autoload.php vendored
View File

@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php'; require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit86f533b8ffd60627cb5e839f88c9b462::getLoader(); return ComposerAutoloaderInit87a6e44dbf0d392dab5e12e5d31e3cdf::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer // autoload_real.php @generated by Composer
class ComposerAutoloaderInit86f533b8ffd60627cb5e839f88c9b462 class ComposerAutoloaderInit87a6e44dbf0d392dab5e12e5d31e3cdf
{ {
private static $loader; private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInit86f533b8ffd60627cb5e839f88c9b462
return self::$loader; return self::$loader;
} }
spl_autoload_register(array('ComposerAutoloaderInit86f533b8ffd60627cb5e839f88c9b462', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInit87a6e44dbf0d392dab5e12e5d31e3cdf', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit86f533b8ffd60627cb5e839f88c9b462', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInit87a6e44dbf0d392dab5e12e5d31e3cdf', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php'; require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit86f533b8ffd60627cb5e839f88c9b462::getInitializer($loader)); call_user_func(\Composer\Autoload\ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf::getInitializer($loader));
$loader->setClassMapAuthoritative(true); $loader->setClassMapAuthoritative(true);
$loader->register(true); $loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit86f533b8ffd60627cb5e839f88c9b462::$files; $includeFiles = \Composer\Autoload\ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf::$files;
foreach ($includeFiles as $fileIdentifier => $file) { foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire86f533b8ffd60627cb5e839f88c9b462($fileIdentifier, $file); composerRequire87a6e44dbf0d392dab5e12e5d31e3cdf($fileIdentifier, $file);
} }
return $loader; return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInit86f533b8ffd60627cb5e839f88c9b462
* @param string $file * @param string $file
* @return void * @return void
*/ */
function composerRequire86f533b8ffd60627cb5e839f88c9b462($fileIdentifier, $file) function composerRequire87a6e44dbf0d392dab5e12e5d31e3cdf($fileIdentifier, $file)
{ {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload; namespace Composer\Autoload;
class ComposerStaticInit86f533b8ffd60627cb5e839f88c9b462 class ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf
{ {
public static $files = array ( public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3122,9 +3122,9 @@ class ComposerStaticInit86f533b8ffd60627cb5e839f88c9b462
public static function getInitializer(ClassLoader $loader) public static function getInitializer(ClassLoader $loader)
{ {
return \Closure::bind(function () use ($loader) { return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit86f533b8ffd60627cb5e839f88c9b462::$prefixLengthsPsr4; $loader->prefixLengthsPsr4 = ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit86f533b8ffd60627cb5e839f88c9b462::$prefixDirsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit86f533b8ffd60627cb5e839f88c9b462::$classMap; $loader->classMap = ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf::$classMap;
}, null, ClassLoader::class); }, null, ClassLoader::class);
} }

View File

@ -1922,12 +1922,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git", "url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git",
"reference": "e60db751903c36be1dd6d3f798a0f4c8909a39fa" "reference": "e6f1461ce8b132049848a97b51ef5f0271993191"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/e60db751903c36be1dd6d3f798a0f4c8909a39fa", "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/e6f1461ce8b132049848a97b51ef5f0271993191",
"reference": "e60db751903c36be1dd6d3f798a0f4c8909a39fa", "reference": "e6f1461ce8b132049848a97b51ef5f0271993191",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1952,7 +1952,7 @@
"symplify\/rule-doc-generator": "^11.1", "symplify\/rule-doc-generator": "^11.1",
"symplify\/vendor-patches": "^11.1" "symplify\/vendor-patches": "^11.1"
}, },
"time": "2022-09-01T19:51:50+00:00", "time": "2022-09-01T21:56:40+00:00",
"default-branch": true, "default-branch": true,
"type": "rector-extension", "type": "rector-extension",
"extra": { "extra": {
@ -2197,12 +2197,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git", "url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
"reference": "b13f5747df67b1a021383633c790e43c926027ed" "reference": "ba7d01bc02d6212793cc4794df506f6af1b90cb2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/b13f5747df67b1a021383633c790e43c926027ed", "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/ba7d01bc02d6212793cc4794df506f6af1b90cb2",
"reference": "b13f5747df67b1a021383633c790e43c926027ed", "reference": "ba7d01bc02d6212793cc4794df506f6af1b90cb2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2233,7 +2233,7 @@
"symplify\/rule-doc-generator": "^11.1", "symplify\/rule-doc-generator": "^11.1",
"symplify\/vendor-patches": "^11.1" "symplify\/vendor-patches": "^11.1"
}, },
"time": "2022-09-01T19:52:16+00:00", "time": "2022-09-01T21:48:10+00:00",
"default-branch": true, "default-branch": true,
"type": "rector-extension", "type": "rector-extension",
"extra": { "extra": {

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/ */
final class GeneratedConfig 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 bfaf952'), '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 e60db75'), '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 cd9db8c'), '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 e5a1d4c'), '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 087730e'), '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 b13f574')); 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 bfaf952'), '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 e6f1461'), '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 cd9db8c'), '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 e5a1d4c'), '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 087730e'), '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 ba7d01b'));
private function __construct() private function __construct()
{ {
} }

View File

@ -77,7 +77,6 @@ interface SomeInterface
{ {
public function test(array $input); public function test(array $input);
} }
final class SomeClass implements SomeInterface final class SomeClass implements SomeInterface
{ {
public function test($input) public function test($input)
@ -93,7 +92,6 @@ interface SomeInterface
*/ */
public function test($input); public function test($input);
} }
final class SomeClass implements SomeInterface final class SomeClass implements SomeInterface
{ {
public function test($input) public function test($input)

View File

@ -155,11 +155,11 @@ final class ArrayMergeFromArraySpreadFactory
// depending on their position. // depending on their position.
// The number can't be at the end of the var name, or it would // The number can't be at the end of the var name, or it would
// conflict with the counter (for if that name is already taken) // conflict with the counter (for if that name is already taken)
$realPath = $file->getFilePath(); $filePath = $file->getFilePath();
$position = $this->lastPositionCurrentFile[$realPath] ?? $position; $position = $this->lastPositionCurrentFile[$filePath] ?? $position;
$variableName = $this->variableNaming->resolveFromNodeWithScopeCountAndFallbackName($array, $mutatingScope, 'item' . $position . 'Unpacked'); $variableName = $this->variableNaming->resolveFromNodeWithScopeCountAndFallbackName($array, $mutatingScope, 'item' . $position . 'Unpacked');
if ($this->shouldIncrement) { if ($this->shouldIncrement) {
$this->lastPositionCurrentFile[$realPath] = ++$position; $this->lastPositionCurrentFile[$filePath] = ++$position;
} }
// Assign the value to the variable, and replace the element with the variable // Assign the value to the variable, and replace the element with the variable
$newVariable = new Variable($variableName); $newVariable = new Variable($variableName);

View File

@ -18,7 +18,7 @@ return static function (RectorConfig $rectorConfig) : void {
'*/Source/*', '*/Source/*',
'*/Source*/*', '*/Source*/*',
'*/tests/*/Fixture*/Expected/*', '*/tests/*/Fixture*/Expected/*',
StringClassNameToClassConstantRector::class => [__DIR__ . '/config'], StringClassNameToClassConstantRector::class,
\Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchMethodCallReturnTypeRector::class => [ \Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchMethodCallReturnTypeRector::class => [
// "data" => "datum" false positive // "data" => "datum" false positive
__DIR__ . '/src/Rector/ClassMethod/AddRouteAnnotationRector.php', __DIR__ . '/src/Rector/ClassMethod/AddRouteAnnotationRector.php',

View File

@ -3,7 +3,7 @@
declare (strict_types=1); declare (strict_types=1);
namespace RectorPrefix202209\Symplify\EasyParallel\FileSystem; namespace RectorPrefix202209\Symplify\EasyParallel\FileSystem;
use Symplify\SmartFileSystem\SmartFileInfo; use RectorPrefix202209\Symplify\SmartFileSystem\SmartFileInfo;
final class FilePathNormalizer final class FilePathNormalizer
{ {
/** /**