Updated Rector to commit d514a5ad79c530cf236308d4f7ab9254e2340996

d514a5ad79 Fix StrictArrayParamDimFetchRector on same named property (#4488)
This commit is contained in:
Tomas Votruba 2023-07-12 08:37:36 +00:00
parent 7312a4cf9b
commit 03be03391c
13 changed files with 49 additions and 46 deletions

View File

@ -6,6 +6,7 @@ namespace Rector\TypeDeclaration\Rector\ClassMethod;
use PhpParser\Node;
use PhpParser\Node\Expr\ArrayDimFetch;
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Identifier;
use PhpParser\Node\Param;
use PhpParser\Node\Stmt\ClassMethod;
@ -99,6 +100,9 @@ CODE_SAMPLE
if (!$node instanceof ArrayDimFetch) {
return null;
}
if (!$node->var instanceof Variable) {
return null;
}
if (!$this->isName($node->var, $paramName)) {
return null;
}

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'd4be167d7e1bc3940db01d3a2096df7aa9cebe1c';
public const PACKAGE_VERSION = 'd514a5ad79c530cf236308d4f7ab9254e2340996';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-07-12 09:07:35';
public const RELEASE_DATE = '2023-07-12 15:33:25';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitf67a3417e8cc86ad5220db43191c6152
class ComposerAutoloaderInit251d11386e762f8e7b00d153f1342213
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInitf67a3417e8cc86ad5220db43191c6152
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitf67a3417e8cc86ad5220db43191c6152', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit251d11386e762f8e7b00d153f1342213', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitf67a3417e8cc86ad5220db43191c6152', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit251d11386e762f8e7b00d153f1342213', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitf67a3417e8cc86ad5220db43191c6152::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit251d11386e762f8e7b00d153f1342213::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInitf67a3417e8cc86ad5220db43191c6152::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit251d11386e762f8e7b00d153f1342213::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

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

View File

@ -2050,12 +2050,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-phpunit.git",
"reference": "1ef67e35a89ddf9e77112a2fade04e8cdcb94f47"
"reference": "4414d4611e2d34ccb9e62ca4b0f780e059c184a7"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/1ef67e35a89ddf9e77112a2fade04e8cdcb94f47",
"reference": "1ef67e35a89ddf9e77112a2fade04e8cdcb94f47",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/4414d4611e2d34ccb9e62ca4b0f780e059c184a7",
"reference": "4414d4611e2d34ccb9e62ca4b0f780e059c184a7",
"shasum": ""
},
"require": {
@ -2084,7 +2084,7 @@
"tomasvotruba\/type-coverage": "^0.1",
"tomasvotruba\/unused-public": "^0.1"
},
"time": "2023-07-12T07:39:03+00:00",
"time": "2023-07-12T08:30:12+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/
final class GeneratedConfig
{
public const EXTENSIONS = array('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 8afdccb'), '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 410d05f'), '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 1ef67e3'), '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 e788554'));
public const EXTENSIONS = array('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 8afdccb'), '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 410d05f'), '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 4414d46'), '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 e788554'));
private function __construct()
{
}

View File

@ -4,9 +4,5 @@ declare (strict_types=1);
namespace RectorPrefix202307;
use Rector\Config\RectorConfig;
use Rector\PHPUnit\Set\PHPUnitLevelSetList;
use Rector\PHPUnit\Set\PHPUnitSetList;
return static function (RectorConfig $rectorConfig) : void {
$rectorConfig->import(PHPUnitSetList::PHPUNIT_91);
$rectorConfig->import(PHPUnitLevelSetList::UP_TO_PHPUNIT_90);
};

View File

@ -4,9 +4,33 @@ declare (strict_types=1);
namespace RectorPrefix202307;
use Rector\Config\RectorConfig;
use Rector\PHPUnit\Rector\Class_\AddProphecyTraitRector;
use Rector\PHPUnit\Rector\Class_\StaticDataProviderClassMethodRector;
use Rector\PHPUnit\Rector\MethodCall\PropertyExistsWithoutAssertRector;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\ValueObject\MethodCallRename;
return static function (RectorConfig $rectorConfig) : void {
$rectorConfig->import(__DIR__ . '/annotations-to-attributes.php');
$rectorConfig->rules([StaticDataProviderClassMethodRector::class, PropertyExistsWithoutAssertRector::class]);
$rectorConfig->rule(AddProphecyTraitRector::class);
$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [
// https://github.com/sebastianbergmann/phpunit/issues/4087
new MethodCallRename('PHPUnit\\Framework\\Assert', 'assertRegExp', 'assertMatchesRegularExpression'),
// https://github.com/sebastianbergmann/phpunit/issues/4090
new MethodCallRename('PHPUnit\\Framework\\Assert', 'assertNotRegExp', 'assertDoesNotMatchRegularExpression'),
// https://github.com/sebastianbergmann/phpunit/issues/4078
new MethodCallRename('PHPUnit\\Framework\\Assert', 'assertFileNotExists', 'assertFileDoesNotExist'),
// https://github.com/sebastianbergmann/phpunit/issues/4081
new MethodCallRename('PHPUnit\\Framework\\Assert', 'assertFileNotIsReadable', 'assertFileIsNotReadable'),
// https://github.com/sebastianbergmann/phpunit/issues/4072
new MethodCallRename('PHPUnit\\Framework\\Assert', 'assertDirectoryNotIsReadable', 'assertDirectoryIsNotReadable'),
// https://github.com/sebastianbergmann/phpunit/issues/4075
new MethodCallRename('PHPUnit\\Framework\\Assert', 'assertDirectoryNotIsWritable', 'assertDirectoryIsNotWritable'),
// https://github.com/sebastianbergmann/phpunit/issues/4069
new MethodCallRename('PHPUnit\\Framework\\Assert', 'assertDirectoryNotExists', 'assertDirectoryDoesNotExist'),
// https://github.com/sebastianbergmann/phpunit/issues/4066
new MethodCallRename('PHPUnit\\Framework\\Assert', 'assertNotIsWritable', 'assertIsNotWritable'),
// https://github.com/sebastianbergmann/phpunit/issues/4063
new MethodCallRename('PHPUnit\\Framework\\Assert', 'assertNotIsReadable', 'assertIsNotReadable'),
]);
};

View File

@ -4,29 +4,6 @@ declare (strict_types=1);
namespace RectorPrefix202307;
use Rector\Config\RectorConfig;
use Rector\PHPUnit\Rector\Class_\AddProphecyTraitRector;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\ValueObject\MethodCallRename;
/** @deprecated Use PHPUnitSetList::PHPUNIT_10 directly */
return static function (RectorConfig $rectorConfig) : void {
$rectorConfig->rule(AddProphecyTraitRector::class);
$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [
// https://github.com/sebastianbergmann/phpunit/issues/4087
new MethodCallRename('PHPUnit\\Framework\\Assert', 'assertRegExp', 'assertMatchesRegularExpression'),
// https://github.com/sebastianbergmann/phpunit/issues/4090
new MethodCallRename('PHPUnit\\Framework\\Assert', 'assertNotRegExp', 'assertDoesNotMatchRegularExpression'),
// https://github.com/sebastianbergmann/phpunit/issues/4078
new MethodCallRename('PHPUnit\\Framework\\Assert', 'assertFileNotExists', 'assertFileDoesNotExist'),
// https://github.com/sebastianbergmann/phpunit/issues/4081
new MethodCallRename('PHPUnit\\Framework\\Assert', 'assertFileNotIsReadable', 'assertFileIsNotReadable'),
// https://github.com/sebastianbergmann/phpunit/issues/4072
new MethodCallRename('PHPUnit\\Framework\\Assert', 'assertDirectoryNotIsReadable', 'assertDirectoryIsNotReadable'),
// https://github.com/sebastianbergmann/phpunit/issues/4075
new MethodCallRename('PHPUnit\\Framework\\Assert', 'assertDirectoryNotIsWritable', 'assertDirectoryIsNotWritable'),
// https://github.com/sebastianbergmann/phpunit/issues/4069
new MethodCallRename('PHPUnit\\Framework\\Assert', 'assertDirectoryNotExists', 'assertDirectoryDoesNotExist'),
// https://github.com/sebastianbergmann/phpunit/issues/4066
new MethodCallRename('PHPUnit\\Framework\\Assert', 'assertNotIsWritable', 'assertIsNotWritable'),
// https://github.com/sebastianbergmann/phpunit/issues/4063
new MethodCallRename('PHPUnit\\Framework\\Assert', 'assertNotIsReadable', 'assertIsNotReadable'),
]);
};

View File

@ -31,6 +31,7 @@ final class PHPUnitLevelSetList implements SetListInterface
public const UP_TO_PHPUNIT_90 = __DIR__ . '/../../config/sets/level/up-to-phpunit-90.php';
/**
* @var string
* @deprecated Use PHPUnitSetList::PHPUNIT_10 directly
*/
public const UP_TO_PHPUNIT_91 = __DIR__ . '/../../config/sets/level/up-to-phpunit-91.php';
/**

View File

@ -38,6 +38,7 @@ final class PHPUnitSetList implements SetListInterface
*/
public const PHPUNIT_90 = __DIR__ . '/../../config/sets/phpunit90.php';
/**
* @deprecated Use PHPUnitSetList::PHPUNIT_10 directly
* @var string
*/
public const PHPUNIT_91 = __DIR__ . '/../../config/sets/phpunit91.php';