mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 11:44:14 +01:00
Updated Rector to commit 12ab2ac8277a0899e2440ea36fb50ace4299f444
12ab2ac827
Fix test to only resolve to known classes (#2663)
This commit is contained in:
parent
a05f4bdb4d
commit
6f2ea78a3d
@ -17,12 +17,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'db7012edc116426e441645abdc1cffcb8c47ee85';
|
||||
public const PACKAGE_VERSION = '12ab2ac8277a0899e2440ea36fb50ace4299f444';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-07-15 10:15:21';
|
||||
public const RELEASE_DATE = '2022-07-16 03:42:02';
|
||||
/**
|
||||
* @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 ComposerAutoloaderInit62cc1573437daadaf699b8f9e1abac1d::getLoader();
|
||||
return ComposerAutoloaderInit5f2e932e4721a50cb3ed73ca5b592961::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 ComposerAutoloaderInit62cc1573437daadaf699b8f9e1abac1d
|
||||
class ComposerAutoloaderInit5f2e932e4721a50cb3ed73ca5b592961
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,19 +22,19 @@ class ComposerAutoloaderInit62cc1573437daadaf699b8f9e1abac1d
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit62cc1573437daadaf699b8f9e1abac1d', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit5f2e932e4721a50cb3ed73ca5b592961', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit62cc1573437daadaf699b8f9e1abac1d', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit5f2e932e4721a50cb3ed73ca5b592961', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit62cc1573437daadaf699b8f9e1abac1d::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit5f2e932e4721a50cb3ed73ca5b592961::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInit62cc1573437daadaf699b8f9e1abac1d::$files;
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInit5f2e932e4721a50cb3ed73ca5b592961::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire62cc1573437daadaf699b8f9e1abac1d($fileIdentifier, $file);
|
||||
composerRequire5f2e932e4721a50cb3ed73ca5b592961($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
@ -46,7 +46,7 @@ class ComposerAutoloaderInit62cc1573437daadaf699b8f9e1abac1d
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequire62cc1573437daadaf699b8f9e1abac1d($fileIdentifier, $file)
|
||||
function composerRequire5f2e932e4721a50cb3ed73ca5b592961($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 ComposerStaticInit62cc1573437daadaf699b8f9e1abac1d
|
||||
class ComposerStaticInit5f2e932e4721a50cb3ed73ca5b592961
|
||||
{
|
||||
public static $files = array (
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
@ -3416,9 +3416,9 @@ class ComposerStaticInit62cc1573437daadaf699b8f9e1abac1d
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit62cc1573437daadaf699b8f9e1abac1d::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit62cc1573437daadaf699b8f9e1abac1d::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit62cc1573437daadaf699b8f9e1abac1d::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit5f2e932e4721a50cb3ed73ca5b592961::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit5f2e932e4721a50cb3ed73ca5b592961::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit5f2e932e4721a50cb3ed73ca5b592961::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
18
vendor/composer/installed.json
vendored
18
vendor/composer/installed.json
vendored
@ -2059,12 +2059,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-generator.git",
|
||||
"reference": "644d45b07c5df78d6d1d65dfb6b3d318dd823b46"
|
||||
"reference": "be4b95ac5bbaa7007aedef2d72870a9403cd58c1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-generator\/zipball\/644d45b07c5df78d6d1d65dfb6b3d318dd823b46",
|
||||
"reference": "644d45b07c5df78d6d1d65dfb6b3d318dd823b46",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-generator\/zipball\/be4b95ac5bbaa7007aedef2d72870a9403cd58c1",
|
||||
"reference": "be4b95ac5bbaa7007aedef2d72870a9403cd58c1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2093,7 +2093,7 @@
|
||||
"symplify\/phpstan-rules": "^11.0",
|
||||
"symplify\/vendor-patches": "^11.0"
|
||||
},
|
||||
"time": "2022-07-01T10:10:08+00:00",
|
||||
"time": "2022-07-15T18:10:34+00:00",
|
||||
"default-branch": true,
|
||||
"type": "rector-extension",
|
||||
"extra": {
|
||||
@ -2118,7 +2118,7 @@
|
||||
"homepage": "https:\/\/getrector.org",
|
||||
"support": {
|
||||
"issues": "https:\/\/github.com\/rectorphp\/rector-generator\/issues",
|
||||
"source": "https:\/\/github.com\/rectorphp\/rector-generator\/tree\/main"
|
||||
"source": "https:\/\/github.com\/rectorphp\/rector-generator\/tree\/0.6.9"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -2347,12 +2347,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-phpunit.git",
|
||||
"reference": "836de491369b697f85990a6fad9ccee929c26f3a"
|
||||
"reference": "b44203e491b69e5638fc439620b39549fa8c1bc6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/836de491369b697f85990a6fad9ccee929c26f3a",
|
||||
"reference": "836de491369b697f85990a6fad9ccee929c26f3a",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/b44203e491b69e5638fc439620b39549fa8c1bc6",
|
||||
"reference": "b44203e491b69e5638fc439620b39549fa8c1bc6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2377,7 +2377,7 @@
|
||||
"symplify\/rule-doc-generator": "^11.0",
|
||||
"symplify\/vendor-patches": "^11.0"
|
||||
},
|
||||
"time": "2022-07-15T14:55:45+00:00",
|
||||
"time": "2022-07-15T15:14:17+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 86ab8c3'), '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 4539d7d'), '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 97f49a2'), 'rector/rector-generator' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-generator', 'relative_install_path' => '../../rector-generator', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 644d45b'), '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 425881a'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main bee7c19'), '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 d826618'), '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 836de49'), '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 6dd877b'));
|
||||
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 86ab8c3'), '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 4539d7d'), '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 97f49a2'), 'rector/rector-generator' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-generator', 'relative_install_path' => '../../rector-generator', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main be4b95a'), '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 425881a'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main bee7c19'), '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 d826618'), '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 b44203e'), '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 6dd877b'));
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
@ -7,8 +7,10 @@ use RectorPrefix202207\Nette\Utils\Json;
|
||||
use RectorPrefix202207\Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\FuncCall;
|
||||
use PHPStan\Node\ClassMethod;
|
||||
use Rector\RectorGenerator\Exception\ConfigurationException;
|
||||
use Rector\RectorGenerator\Exception\ShouldNotHappenException;
|
||||
use RectorPrefix202207\Webmozart\Assert\Assert;
|
||||
final class RectorRecipe
|
||||
{
|
||||
/**
|
||||
@ -188,6 +190,8 @@ final class RectorRecipe
|
||||
private function setNodeTypes(array $nodeTypes) : void
|
||||
{
|
||||
foreach ($nodeTypes as $nodeType) {
|
||||
// avoid phpstan class method that is never traversed
|
||||
Assert::isNotA($nodeType, ClassMethod::class);
|
||||
if (\is_a($nodeType, Node::class, \true)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -4,8 +4,10 @@ declare (strict_types=1);
|
||||
namespace Rector\PHPUnit\Rector\MethodCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
use PhpParser\Node\Expr\StaticCall;
|
||||
use PhpParser\Node\Scalar\Encapsed;
|
||||
use PHPStan\Type\Constant\ConstantArrayType;
|
||||
use PHPStan\Type\FloatType;
|
||||
use PHPStan\Type\IntegerType;
|
||||
@ -75,8 +77,8 @@ final class AssertEqualsToSameRector extends AbstractRector
|
||||
if (!isset($args[0])) {
|
||||
return null;
|
||||
}
|
||||
$valueNodeType = $this->nodeTypeResolver->getType($args[0]->value);
|
||||
if (!$this->isScalarType($valueNodeType)) {
|
||||
$firstArgValue = $args[0]->value;
|
||||
if (!$this->isScalarValue($firstArgValue)) {
|
||||
return null;
|
||||
}
|
||||
$hasChanged = $this->identifierManipulator->renameNodeWithMap($node, self::RENAME_METHODS_MAP);
|
||||
@ -91,4 +93,12 @@ final class AssertEqualsToSameRector extends AbstractRector
|
||||
}
|
||||
return \false;
|
||||
}
|
||||
private function isScalarValue(Expr $expr) : bool
|
||||
{
|
||||
if ($expr instanceof Encapsed) {
|
||||
return \true;
|
||||
}
|
||||
$valueNodeType = $this->nodeTypeResolver->getType($expr);
|
||||
return $this->isScalarType($valueNodeType);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user