mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 22:08:00 +01:00
Updated Rector to commit b4ce499d88e2277d142d4feb97385140e1faa47d
b4ce499d88
[PhpParser] Remove parent lookup on BetterNodeFinder::hasInstancesOfInFunctionLikeScoped() (#4254)
This commit is contained in:
parent
9c5daaf368
commit
b34c14e84b
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'b5cafa24ba8c2ac4d7a92341adb6af686dd0581f';
|
||||
public const PACKAGE_VERSION = 'b4ce499d88e2277d142d4feb97385140e1faa47d';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-06-17 17:42:31';
|
||||
public const RELEASE_DATE = '2023-06-17 17:46:44';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -319,16 +319,20 @@ final class BetterNodeFinder
|
||||
if (\is_string($types)) {
|
||||
$types = [$types];
|
||||
}
|
||||
foreach ($types as $type) {
|
||||
$foundNodes = $this->findInstanceOf((array) $functionLike->stmts, $type);
|
||||
foreach ($foundNodes as $foundNode) {
|
||||
$parentFunctionLike = $this->findParentByTypes($foundNode, [ClassMethod::class, Function_::class, Closure::class]);
|
||||
if ($parentFunctionLike === $functionLike) {
|
||||
return \true;
|
||||
$isFoundNode = \false;
|
||||
$this->simpleCallableNodeTraverser->traverseNodesWithCallable((array) $functionLike->stmts, static function (Node $subNode) use($types, &$isFoundNode) : ?int {
|
||||
if ($subNode instanceof Class_ || $subNode instanceof Function_ || $subNode instanceof Closure) {
|
||||
return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
|
||||
}
|
||||
foreach ($types as $type) {
|
||||
if ($subNode instanceof $type) {
|
||||
$isFoundNode = \true;
|
||||
return NodeTraverser::STOP_TRAVERSAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
return \false;
|
||||
return null;
|
||||
});
|
||||
return $isFoundNode;
|
||||
}
|
||||
/**
|
||||
* @template T of Node
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit43e31d337be7dc1648be8823b77b2b05::getLoader();
|
||||
return ComposerAutoloaderInit7936f9413177c794984a963713499460::getLoader();
|
||||
|
10
vendor/composer/autoload_real.php
vendored
10
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit43e31d337be7dc1648be8823b77b2b05
|
||||
class ComposerAutoloaderInit7936f9413177c794984a963713499460
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInit43e31d337be7dc1648be8823b77b2b05
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit43e31d337be7dc1648be8823b77b2b05', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit7936f9413177c794984a963713499460', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit43e31d337be7dc1648be8823b77b2b05', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit7936f9413177c794984a963713499460', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit43e31d337be7dc1648be8823b77b2b05::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit7936f9413177c794984a963713499460::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit43e31d337be7dc1648be8823b77b2b05::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit7936f9413177c794984a963713499460::$files;
|
||||
$requireFile = \Closure::bind(static function ($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 ComposerStaticInit43e31d337be7dc1648be8823b77b2b05
|
||||
class ComposerStaticInit7936f9413177c794984a963713499460
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3094,9 +3094,9 @@ class ComposerStaticInit43e31d337be7dc1648be8823b77b2b05
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit43e31d337be7dc1648be8823b77b2b05::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit43e31d337be7dc1648be8823b77b2b05::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit43e31d337be7dc1648be8823b77b2b05::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit7936f9413177c794984a963713499460::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit7936f9413177c794984a963713499460::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit7936f9413177c794984a963713499460::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user