Updated Rector to commit 8eedf1878f6882c8cba5b696613828a6ae15790d

8eedf1878f [Php71] Skip First Class Callable on RemoveExtraParametersRector (#2622)
This commit is contained in:
Tomas Votruba 2022-07-03 17:06:40 +00:00
parent 76fb7eb0e9
commit 606cd7be37
6 changed files with 21 additions and 14 deletions

View File

@ -15,6 +15,7 @@ use PhpParser\Node\Name;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\Enum_;
use PhpParser\Node\Stmt\Expression;
use PhpParser\Node\Stmt\Finally_;
use PhpParser\Node\Stmt\Foreach_;
use PhpParser\Node\Stmt\Interface_;
@ -143,6 +144,9 @@ final class PHPStanNodeScopeResolver
$scope = $formerMutatingScope ?? $this->scopeFactory->createFromFile($smartFileInfo);
// skip chain method calls, performance issue: https://github.com/phpstan/phpstan/issues/254
$nodeCallback = function (Node $node, MutatingScope $mutatingScope) use(&$nodeCallback, $isScopeRefreshing, $smartFileInfo) : void {
if ($node instanceof Expression) {
$node->expr->setAttribute(AttributeKey::SCOPE, $mutatingScope);
}
if ($node instanceof Ternary) {
$this->processTernary($node, $mutatingScope);
}

View File

@ -82,6 +82,9 @@ final class RemoveExtraParametersRector extends AbstractRector implements MinPhp
}
$maximumAllowedParameterCount = $this->resolveMaximumAllowedParameterCount($functionLikeReflection);
//
if ($node->isFirstClassCallable()) {
return null;
}
$numberOfArguments = \count($node->getRawArgs());
if ($numberOfArguments <= $maximumAllowedParameterCount) {
return null;

View File

@ -17,12 +17,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'dfc6e1d9c05a4ab0c861332298d3184763d9ebfb';
public const PACKAGE_VERSION = '8eedf1878f6882c8cba5b696613828a6ae15790d';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2022-07-03 16:29:14';
public const RELEASE_DATE = '2022-07-03 19:01:36';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInita850dba1f031cfbafe4cb9ef8ddc7b73
class ComposerAutoloaderInit07bac8f7205b1fa239a4e44e121247a2
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInita850dba1f031cfbafe4cb9ef8ddc7b73
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInita850dba1f031cfbafe4cb9ef8ddc7b73', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit07bac8f7205b1fa239a4e44e121247a2', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInita850dba1f031cfbafe4cb9ef8ddc7b73', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit07bac8f7205b1fa239a4e44e121247a2', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInita850dba1f031cfbafe4cb9ef8ddc7b73::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit07bac8f7205b1fa239a4e44e121247a2::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInita850dba1f031cfbafe4cb9ef8ddc7b73::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInit07bac8f7205b1fa239a4e44e121247a2::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequirea850dba1f031cfbafe4cb9ef8ddc7b73($fileIdentifier, $file);
composerRequire07bac8f7205b1fa239a4e44e121247a2($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInita850dba1f031cfbafe4cb9ef8ddc7b73
* @param string $file
* @return void
*/
function composerRequirea850dba1f031cfbafe4cb9ef8ddc7b73($fileIdentifier, $file)
function composerRequire07bac8f7205b1fa239a4e44e121247a2($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 ComposerStaticInita850dba1f031cfbafe4cb9ef8ddc7b73
class ComposerStaticInit07bac8f7205b1fa239a4e44e121247a2
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@ -3416,9 +3416,9 @@ class ComposerStaticInita850dba1f031cfbafe4cb9ef8ddc7b73
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInita850dba1f031cfbafe4cb9ef8ddc7b73::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInita850dba1f031cfbafe4cb9ef8ddc7b73::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInita850dba1f031cfbafe4cb9ef8ddc7b73::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit07bac8f7205b1fa239a4e44e121247a2::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit07bac8f7205b1fa239a4e44e121247a2::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit07bac8f7205b1fa239a4e44e121247a2::$classMap;
}, null, ClassLoader::class);
}