Updated Rector to commit 3e66b4a6348e2d106dc714760c946003bdc9807d

3e66b4a634 add multi args acceptor (#2605)
This commit is contained in:
Tomas Votruba 2022-07-01 14:24:55 +00:00
parent 84dff4485c
commit 7b91c0386b
5 changed files with 27 additions and 15 deletions

View File

@ -13,6 +13,7 @@ use PhpParser\Node\Scalar\LNumber;
use PhpParser\Node\Scalar\MagicConst;
use PhpParser\Node\Scalar\MagicConst\Line;
use PhpParser\Node\Scalar\String_;
use PHPStan\Analyser\Scope;
use PHPStan\Reflection\Native\NativeFunctionReflection;
use PHPStan\Reflection\ParametersAcceptorSelector;
use PHPStan\Reflection\ReflectionProvider;
@ -22,6 +23,7 @@ use PHPStan\Type\IntegerType;
use PHPStan\Type\NullType;
use PHPStan\Type\StringType;
use PHPStan\Type\Type;
use Rector\NodeTypeResolver\Node\AttributeKey;
final class AlwaysStrictScalarExprAnalyzer
{
/**
@ -87,7 +89,17 @@ final class AlwaysStrictScalarExprAnalyzer
if (!$functionReflection instanceof NativeFunctionReflection) {
return null;
}
$parametersAcceptor = ParametersAcceptorSelector::selectSingle($functionReflection->getVariants());
$variants = $functionReflection->getVariants();
if (\count($variants) > 1) {
$scope = $funcCall->getAttribute(AttributeKey::SCOPE);
if ($scope instanceof Scope) {
$parametersAcceptor = ParametersAcceptorSelector::selectFromArgs($scope, $funcCall->getArgs(), $variants);
} else {
return null;
}
} else {
$parametersAcceptor = ParametersAcceptorSelector::selectSingle($variants);
}
return $parametersAcceptor->getReturnType();
}
}

View File

@ -17,12 +17,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '12f380b343bc991d5b138206d68cd244d0aca776';
public const PACKAGE_VERSION = '3e66b4a6348e2d106dc714760c946003bdc9807d';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2022-07-01 13:44:45';
public const RELEASE_DATE = '2022-07-01 14:18:00';
/**
* @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 ComposerAutoloaderInitff1e44c833696380e46e3ef666f7b6ee::getLoader();
return ComposerAutoloaderInit6ba007e97e3d58984bd9bd00d6e531bc::getLoader();

View File

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