mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 21:38:22 +01:00
Updated Rector to commit 0d62894545caec468b9ff170cfcf0566ccab6d3d
0d62894545
[StaticTypeMapper] Remove #[Required] on IntersectionTypeNodeMapper (#4687)
This commit is contained in:
parent
aa4367814a
commit
d2266d0a76
@ -4,26 +4,36 @@ declare (strict_types=1);
|
||||
namespace Rector\StaticTypeMapper\PhpParser;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Name;
|
||||
use PhpParser\Node\Name\FullyQualified;
|
||||
use PHPStan\Type\IntersectionType;
|
||||
use PHPStan\Type\Type;
|
||||
use Rector\StaticTypeMapper\Contract\PhpParser\PhpParserNodeMapperInterface;
|
||||
use Rector\StaticTypeMapper\Mapper\PhpParserNodeMapper;
|
||||
use RectorPrefix202308\Symfony\Contracts\Service\Attribute\Required;
|
||||
/**
|
||||
* @implements PhpParserNodeMapperInterface<Node\IntersectionType>
|
||||
*/
|
||||
final class IntersectionTypeNodeMapper implements PhpParserNodeMapperInterface
|
||||
{
|
||||
/**
|
||||
* @var \Rector\StaticTypeMapper\Mapper\PhpParserNodeMapper
|
||||
* @readonly
|
||||
* @var \Rector\StaticTypeMapper\PhpParser\FullyQualifiedNodeMapper
|
||||
*/
|
||||
private $phpParserNodeMapper;
|
||||
private $fullyQualifiedNodeMapper;
|
||||
/**
|
||||
* @required
|
||||
* @readonly
|
||||
* @var \Rector\StaticTypeMapper\PhpParser\NameNodeMapper
|
||||
*/
|
||||
public function autowire(PhpParserNodeMapper $phpParserNodeMapper) : void
|
||||
private $nameNodeMapper;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\StaticTypeMapper\PhpParser\IdentifierNodeMapper
|
||||
*/
|
||||
private $identifierNodeMapper;
|
||||
public function __construct(\Rector\StaticTypeMapper\PhpParser\FullyQualifiedNodeMapper $fullyQualifiedNodeMapper, \Rector\StaticTypeMapper\PhpParser\NameNodeMapper $nameNodeMapper, \Rector\StaticTypeMapper\PhpParser\IdentifierNodeMapper $identifierNodeMapper)
|
||||
{
|
||||
$this->phpParserNodeMapper = $phpParserNodeMapper;
|
||||
$this->fullyQualifiedNodeMapper = $fullyQualifiedNodeMapper;
|
||||
$this->nameNodeMapper = $nameNodeMapper;
|
||||
$this->identifierNodeMapper = $identifierNodeMapper;
|
||||
}
|
||||
public function getNodeType() : string
|
||||
{
|
||||
@ -36,7 +46,15 @@ final class IntersectionTypeNodeMapper implements PhpParserNodeMapperInterface
|
||||
{
|
||||
$types = [];
|
||||
foreach ($node->types as $intersectionedType) {
|
||||
$types[] = $this->phpParserNodeMapper->mapToPHPStanType($intersectionedType);
|
||||
if ($intersectionedType instanceof FullyQualified) {
|
||||
$types[] = $this->fullyQualifiedNodeMapper->mapToPHPStan($intersectionedType);
|
||||
continue;
|
||||
}
|
||||
if ($intersectionedType instanceof Name) {
|
||||
$types[] = $this->nameNodeMapper->mapToPHPStan($intersectionedType);
|
||||
continue;
|
||||
}
|
||||
$types[] = $this->identifierNodeMapper->mapToPHPStan($intersectionedType);
|
||||
}
|
||||
return new IntersectionType($types);
|
||||
}
|
||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '1fefdc4a4fb41b1e95f33f8962d034c88a551950';
|
||||
public const PACKAGE_VERSION = '0d62894545caec468b9ff170cfcf0566ccab6d3d';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-08-06 23:24:35';
|
||||
public const RELEASE_DATE = '2023-08-07 10:09:16';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
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 ComposerAutoloaderInit479b50be08209e9465a096c2c3920a0a::getLoader();
|
||||
return ComposerAutoloaderInit339d5a9e2bfea805998bfe04c2e8d03d::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 ComposerAutoloaderInit479b50be08209e9465a096c2c3920a0a
|
||||
class ComposerAutoloaderInit339d5a9e2bfea805998bfe04c2e8d03d
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInit479b50be08209e9465a096c2c3920a0a
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit479b50be08209e9465a096c2c3920a0a', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit339d5a9e2bfea805998bfe04c2e8d03d', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit479b50be08209e9465a096c2c3920a0a', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit339d5a9e2bfea805998bfe04c2e8d03d', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit479b50be08209e9465a096c2c3920a0a::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit339d5a9e2bfea805998bfe04c2e8d03d::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit479b50be08209e9465a096c2c3920a0a::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit339d5a9e2bfea805998bfe04c2e8d03d::$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 ComposerStaticInit479b50be08209e9465a096c2c3920a0a
|
||||
class ComposerStaticInit339d5a9e2bfea805998bfe04c2e8d03d
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3010,9 +3010,9 @@ class ComposerStaticInit479b50be08209e9465a096c2c3920a0a
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit479b50be08209e9465a096c2c3920a0a::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit479b50be08209e9465a096c2c3920a0a::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit479b50be08209e9465a096c2c3920a0a::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit339d5a9e2bfea805998bfe04c2e8d03d::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit339d5a9e2bfea805998bfe04c2e8d03d::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit339d5a9e2bfea805998bfe04c2e8d03d::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user