mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-16 13:00:23 +01:00
Updated Rector to commit dc22a952fe92e3574a27c8e9e7de3d9aead42a4f
dc22a952fe
[Scoped] Clean up SmartFileInfo (#2889)
This commit is contained in:
parent
6d11119b51
commit
277e853737
@ -23,12 +23,4 @@ spl_autoload_register(function (string $class): void {
|
||||
$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;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -6,7 +6,6 @@ namespace Rector\Testing\Fixture;
|
||||
use Iterator;
|
||||
use RectorPrefix202209\Symfony\Component\Finder\Finder;
|
||||
use RectorPrefix202209\Symfony\Component\Finder\SplFileInfo;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
final class FixtureFileFinder
|
||||
{
|
||||
/**
|
||||
@ -19,18 +18,6 @@ final class FixtureFileFinder
|
||||
(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[]
|
||||
*/
|
||||
|
@ -24,7 +24,6 @@ use Rector\Testing\Fixture\FixtureFileUpdater;
|
||||
use Rector\Testing\Fixture\FixtureSplitter;
|
||||
use Rector\Testing\Fixture\FixtureTempFileDumper;
|
||||
use Rector\Testing\PHPUnit\Behavior\MovingFilesTrait;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
abstract class AbstractRectorTestCase extends \Rector\Testing\PHPUnit\AbstractTestCase implements RectorTestInterface
|
||||
{
|
||||
use MovingFilesTrait;
|
||||
@ -113,14 +112,6 @@ abstract class AbstractRectorTestCase extends \Rector\Testing\PHPUnit\AbstractTe
|
||||
$this->originalTempFilePath = $inputFilePath;
|
||||
$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
|
||||
{
|
||||
return FixtureTempFileDumper::getTempDirectory();
|
||||
|
@ -17,12 +17,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '2c454d292b8af3a8e8eb61f813efe6b12c66ae81';
|
||||
public const PACKAGE_VERSION = 'dc22a952fe92e3574a27c8e9e7de3d9aead42a4f';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-09-01 23:01:02';
|
||||
public const RELEASE_DATE = '2022-09-02 05:01:35';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit86f533b8ffd60627cb5e839f88c9b462::getLoader();
|
||||
return ComposerAutoloaderInit87a6e44dbf0d392dab5e12e5d31e3cdf::getLoader();
|
||||
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit86f533b8ffd60627cb5e839f88c9b462
|
||||
class ComposerAutoloaderInit87a6e44dbf0d392dab5e12e5d31e3cdf
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,19 +22,19 @@ class ComposerAutoloaderInit86f533b8ffd60627cb5e839f88c9b462
|
||||
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__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit86f533b8ffd60627cb5e839f88c9b462', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit87a6e44dbf0d392dab5e12e5d31e3cdf', 'loadClassLoader'));
|
||||
|
||||
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->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInit86f533b8ffd60627cb5e839f88c9b462::$files;
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire86f533b8ffd60627cb5e839f88c9b462($fileIdentifier, $file);
|
||||
composerRequire87a6e44dbf0d392dab5e12e5d31e3cdf($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
@ -46,7 +46,7 @@ class ComposerAutoloaderInit86f533b8ffd60627cb5e839f88c9b462
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequire86f533b8ffd60627cb5e839f88c9b462($fileIdentifier, $file)
|
||||
function composerRequire87a6e44dbf0d392dab5e12e5d31e3cdf($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit86f533b8ffd60627cb5e839f88c9b462
|
||||
class ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3122,9 +3122,9 @@ class ComposerStaticInit86f533b8ffd60627cb5e839f88c9b462
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit86f533b8ffd60627cb5e839f88c9b462::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit86f533b8ffd60627cb5e839f88c9b462::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit86f533b8ffd60627cb5e839f88c9b462::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
16
vendor/composer/installed.json
vendored
16
vendor/composer/installed.json
vendored
@ -1922,12 +1922,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git",
|
||||
"reference": "e60db751903c36be1dd6d3f798a0f4c8909a39fa"
|
||||
"reference": "e6f1461ce8b132049848a97b51ef5f0271993191"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/e60db751903c36be1dd6d3f798a0f4c8909a39fa",
|
||||
"reference": "e60db751903c36be1dd6d3f798a0f4c8909a39fa",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/e6f1461ce8b132049848a97b51ef5f0271993191",
|
||||
"reference": "e6f1461ce8b132049848a97b51ef5f0271993191",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1952,7 +1952,7 @@
|
||||
"symplify\/rule-doc-generator": "^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,
|
||||
"type": "rector-extension",
|
||||
"extra": {
|
||||
@ -2197,12 +2197,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
|
||||
"reference": "b13f5747df67b1a021383633c790e43c926027ed"
|
||||
"reference": "ba7d01bc02d6212793cc4794df506f6af1b90cb2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/b13f5747df67b1a021383633c790e43c926027ed",
|
||||
"reference": "b13f5747df67b1a021383633c790e43c926027ed",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/ba7d01bc02d6212793cc4794df506f6af1b90cb2",
|
||||
"reference": "ba7d01bc02d6212793cc4794df506f6af1b90cb2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2233,7 +2233,7 @@
|
||||
"symplify\/rule-doc-generator": "^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,
|
||||
"type": "rector-extension",
|
||||
"extra": {
|
||||
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
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 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()
|
||||
{
|
||||
}
|
||||
|
@ -77,7 +77,6 @@ interface SomeInterface
|
||||
{
|
||||
public function test(array $input);
|
||||
}
|
||||
|
||||
final class SomeClass implements SomeInterface
|
||||
{
|
||||
public function test($input)
|
||||
@ -93,7 +92,6 @@ interface SomeInterface
|
||||
*/
|
||||
public function test($input);
|
||||
}
|
||||
|
||||
final class SomeClass implements SomeInterface
|
||||
{
|
||||
public function test($input)
|
||||
|
@ -155,11 +155,11 @@ final class ArrayMergeFromArraySpreadFactory
|
||||
// depending on their position.
|
||||
// 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)
|
||||
$realPath = $file->getFilePath();
|
||||
$position = $this->lastPositionCurrentFile[$realPath] ?? $position;
|
||||
$filePath = $file->getFilePath();
|
||||
$position = $this->lastPositionCurrentFile[$filePath] ?? $position;
|
||||
$variableName = $this->variableNaming->resolveFromNodeWithScopeCountAndFallbackName($array, $mutatingScope, 'item' . $position . 'Unpacked');
|
||||
if ($this->shouldIncrement) {
|
||||
$this->lastPositionCurrentFile[$realPath] = ++$position;
|
||||
$this->lastPositionCurrentFile[$filePath] = ++$position;
|
||||
}
|
||||
// Assign the value to the variable, and replace the element with the variable
|
||||
$newVariable = new Variable($variableName);
|
||||
|
2
vendor/rector/rector-symfony/rector.php
vendored
2
vendor/rector/rector-symfony/rector.php
vendored
@ -18,7 +18,7 @@ return static function (RectorConfig $rectorConfig) : void {
|
||||
'*/Source/*',
|
||||
'*/Source*/*',
|
||||
'*/tests/*/Fixture*/Expected/*',
|
||||
StringClassNameToClassConstantRector::class => [__DIR__ . '/config'],
|
||||
StringClassNameToClassConstantRector::class,
|
||||
\Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchMethodCallReturnTypeRector::class => [
|
||||
// "data" => "datum" false positive
|
||||
__DIR__ . '/src/Rector/ClassMethod/AddRouteAnnotationRector.php',
|
||||
|
@ -3,7 +3,7 @@
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\EasyParallel\FileSystem;
|
||||
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
use RectorPrefix202209\Symplify\SmartFileSystem\SmartFileInfo;
|
||||
final class FilePathNormalizer
|
||||
{
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user