Updated Rector to commit 10558a8d5fb68c0564f995a008b4c666ff932a03

10558a8d5f [NodeTypeResolver] Use existing DefaultReflector::reflectAllClasses() method on DynamicSourceLocatorProvider (#5856)
This commit is contained in:
Tomas Votruba 2024-05-02 19:23:28 +00:00
parent fb4bddec05
commit 19b93eeeab
4 changed files with 16 additions and 10 deletions

View File

@ -1802,12 +1802,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-phpunit.git",
"reference": "7065f6eb4108e0c5ccff18582d6dc03a65bf7bdc"
"reference": "d075c4f212255cbdeeb8ff837dd41762fbfce931"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/7065f6eb4108e0c5ccff18582d6dc03a65bf7bdc",
"reference": "7065f6eb4108e0c5ccff18582d6dc03a65bf7bdc",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/d075c4f212255cbdeeb8ff837dd41762fbfce931",
"reference": "d075c4f212255cbdeeb8ff837dd41762fbfce931",
"shasum": ""
},
"require": {
@ -1830,7 +1830,7 @@
"tomasvotruba\/class-leak": "^0.2.13",
"tracy\/tracy": "^2.10"
},
"time": "2024-04-29T12:33:53+00:00",
"time": "2024-05-02T19:17:47+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/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main 364e273'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 4228a73'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main 7065f6e'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 040014c'));
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main 364e273'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 4228a73'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main d075c4f'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 040014c'));
private function __construct()
{
}

View File

@ -8,6 +8,7 @@ use PhpParser\Node\Arg;
use PhpParser\Node\Expr\Instanceof_;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Expr\Variable;
use Rector\Exception\ShouldNotHappenException;
use Rector\PHPUnit\NodeAnalyzer\IdentifierManipulator;
use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer;
@ -79,10 +80,15 @@ final class AssertInstanceOfComparisonRector extends AbstractRector
$comparison = $oldArguments[0]->value;
$argument = $comparison->expr;
unset($oldArguments[0]);
$className = $this->getName($comparison->class);
if ($className === null) {
throw new ShouldNotHappenException();
if ($comparison->class instanceof Variable) {
$firstArgument = new Arg($comparison->class);
} else {
$className = $this->getName($comparison->class);
if ($className === null) {
throw new ShouldNotHappenException();
}
$firstArgument = new Arg($this->nodeFactory->createClassConstReference($className));
}
$node->args = \array_merge([new Arg($this->nodeFactory->createClassConstReference($className)), new Arg($argument)], $oldArguments);
$node->args = \array_merge([$firstArgument, new Arg($argument)], $oldArguments);
}
}