Updated Rector to commit bb284f658574249ce2f2da444b8c0d982b811819

bb284f6585 [PHPStanStaticTypeMapper] Reduce autowire() parameter on ArrayTypeMapper (#4696)
This commit is contained in:
Tomas Votruba 2023-08-07 05:11:00 +00:00
parent 16793c8988
commit fa20ce4ba0
6 changed files with 32 additions and 28 deletions

View File

@ -35,41 +35,48 @@ use RectorPrefix202308\Symfony\Contracts\Service\Attribute\Required;
final class ArrayTypeMapper implements TypeMapperInterface
{
/**
* @var string
*/
public const HAS_GENERIC_TYPE_PARENT = 'has_generic_type_parent';
/**
* @var \Rector\PHPStanStaticTypeMapper\PHPStanStaticTypeMapper
*/
private $phpStanStaticTypeMapper;
/**
* @readonly
* @var \Rector\PHPStanStaticTypeMapper\TypeAnalyzer\UnionTypeCommonTypeNarrower
*/
private $unionTypeCommonTypeNarrower;
/**
* @readonly
* @var \PHPStan\Reflection\ReflectionProvider
*/
private $reflectionProvider;
/**
* @readonly
* @var \Rector\TypeDeclaration\TypeAnalyzer\GenericClassStringTypeNormalizer
*/
private $genericClassStringTypeNormalizer;
/**
* @readonly
* @var \Rector\TypeDeclaration\NodeTypeAnalyzer\DetailedTypeAnalyzer
*/
private $detailedTypeAnalyzer;
// To avoid circular dependency
/**
* @required
* @var string
*/
public function autowire(PHPStanStaticTypeMapper $phpStanStaticTypeMapper, UnionTypeCommonTypeNarrower $unionTypeCommonTypeNarrower, ReflectionProvider $reflectionProvider, GenericClassStringTypeNormalizer $genericClassStringTypeNormalizer, DetailedTypeAnalyzer $detailedTypeAnalyzer) : void
public const HAS_GENERIC_TYPE_PARENT = 'has_generic_type_parent';
public function __construct(UnionTypeCommonTypeNarrower $unionTypeCommonTypeNarrower, ReflectionProvider $reflectionProvider, GenericClassStringTypeNormalizer $genericClassStringTypeNormalizer, DetailedTypeAnalyzer $detailedTypeAnalyzer)
{
$this->phpStanStaticTypeMapper = $phpStanStaticTypeMapper;
$this->unionTypeCommonTypeNarrower = $unionTypeCommonTypeNarrower;
$this->reflectionProvider = $reflectionProvider;
$this->genericClassStringTypeNormalizer = $genericClassStringTypeNormalizer;
$this->detailedTypeAnalyzer = $detailedTypeAnalyzer;
}
/**
* @var \Rector\PHPStanStaticTypeMapper\PHPStanStaticTypeMapper
*/
private $phpStanStaticTypeMapper;
// To avoid circular dependency
/**
* @required
*/
public function autowire(PHPStanStaticTypeMapper $phpStanStaticTypeMapper) : void
{
$this->phpStanStaticTypeMapper = $phpStanStaticTypeMapper;
}
/**
* @return class-string<Type>
*/

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'a459f5ac61ecfd01d680ef5ffb825471ad3cb11b';
public const PACKAGE_VERSION = 'bb284f658574249ce2f2da444b8c0d982b811819';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-08-07 11:50:07';
public const RELEASE_DATE = '2023-08-07 12:06:43';
/**
* @var int
*/

View File

@ -81,7 +81,6 @@ use Rector\PhpAttribute\AnnotationToAttributeMapper\StringNodeAnnotationToAttrib
use Rector\PhpAttribute\Contract\AnnotationToAttributeMapperInterface;
use Rector\PHPStanStaticTypeMapper\Contract\TypeMapperInterface;
use Rector\PHPStanStaticTypeMapper\PHPStanStaticTypeMapper;
use Rector\PHPStanStaticTypeMapper\TypeAnalyzer\UnionTypeCommonTypeNarrower;
use Rector\PHPStanStaticTypeMapper\TypeMapper\AccessoryLiteralStringTypeMapper;
use Rector\PHPStanStaticTypeMapper\TypeMapper\AccessoryNonEmptyStringTypeMapper;
use Rector\PHPStanStaticTypeMapper\TypeMapper\AccessoryNonFalsyStringTypeMapper;
@ -134,8 +133,6 @@ use Rector\StaticTypeMapper\PhpParser\NullableTypeNodeMapper;
use Rector\StaticTypeMapper\PhpParser\StringNodeMapper;
use Rector\StaticTypeMapper\PhpParser\UnionTypeNodeMapper;
use Rector\StaticTypeMapper\StaticTypeMapper;
use Rector\TypeDeclaration\NodeTypeAnalyzer\DetailedTypeAnalyzer;
use Rector\TypeDeclaration\TypeAnalyzer\GenericClassStringTypeNormalizer;
use RectorPrefix202308\Symfony\Component\Console\Application;
use RectorPrefix202308\Webmozart\Assert\Assert;
final class LazyContainerFactory
@ -232,7 +229,7 @@ final class LazyContainerFactory
$nameScopeFactory->autowire($container->make(PhpDocInfoFactory::class), $container->make(StaticTypeMapper::class));
});
$container->afterResolving(ArrayTypeMapper::class, static function (ArrayTypeMapper $arrayTypeMapper, Container $container) : void {
$arrayTypeMapper->autowire($container->make(PHPStanStaticTypeMapper::class), $container->make(UnionTypeCommonTypeNarrower::class), $container->make(ReflectionProvider::class), $container->make(GenericClassStringTypeNormalizer::class), $container->make(DetailedTypeAnalyzer::class));
$arrayTypeMapper->autowire($container->make(PHPStanStaticTypeMapper::class));
});
$container->afterResolving(PlainValueParser::class, static function (PlainValueParser $plainValueParser, Container $container) : void {
$plainValueParser->autowire($container->make(StaticDoctrineAnnotationParser::class), $container->make(ArrayParser::class));

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitb53137707652d6dda531d4f6cd59324f
class ComposerAutoloaderInit4013706d2dd11978b824fafafdd023d2
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInitb53137707652d6dda531d4f6cd59324f
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitb53137707652d6dda531d4f6cd59324f', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit4013706d2dd11978b824fafafdd023d2', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitb53137707652d6dda531d4f6cd59324f', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit4013706d2dd11978b824fafafdd023d2', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitb53137707652d6dda531d4f6cd59324f::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit4013706d2dd11978b824fafafdd023d2::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInitb53137707652d6dda531d4f6cd59324f::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit4013706d2dd11978b824fafafdd023d2::$files;
$requireFile = \Closure::bind(static function ($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 ComposerStaticInitb53137707652d6dda531d4f6cd59324f
class ComposerStaticInit4013706d2dd11978b824fafafdd023d2
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3010,9 +3010,9 @@ class ComposerStaticInitb53137707652d6dda531d4f6cd59324f
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitb53137707652d6dda531d4f6cd59324f::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitb53137707652d6dda531d4f6cd59324f::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitb53137707652d6dda531d4f6cd59324f::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit4013706d2dd11978b824fafafdd023d2::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit4013706d2dd11978b824fafafdd023d2::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit4013706d2dd11978b824fafafdd023d2::$classMap;
}, null, ClassLoader::class);
}