Updated Rector to commit fd04aa8db977151cc4147289c3d9b81c1ce53dcf

fd04aa8db9 [PHPStanStaticTypeMapper] Remove Doctrine\Common\Collections\Collection check on UnionTypeMapper (#5150)
This commit is contained in:
Tomas Votruba 2023-10-10 07:11:47 +00:00
parent 2dacf5e7e8
commit 7aea9b9ed8
4 changed files with 8 additions and 19 deletions

View File

@ -30,7 +30,6 @@ use Rector\Core\ValueObject\PhpVersionFeature;
use Rector\NodeNameResolver\NodeNameResolver;
use Rector\NodeTypeResolver\PHPStan\Type\TypeFactory;
use Rector\PHPStanStaticTypeMapper\Contract\TypeMapperInterface;
use Rector\PHPStanStaticTypeMapper\DoctrineTypeAnalyzer;
use Rector\PHPStanStaticTypeMapper\Enum\TypeKind;
use Rector\PHPStanStaticTypeMapper\PHPStanStaticTypeMapper;
use Rector\PHPStanStaticTypeMapper\TypeAnalyzer\UnionTypeAnalyzer;
@ -42,11 +41,6 @@ use RectorPrefix202310\Webmozart\Assert\InvalidArgumentException;
*/
final class UnionTypeMapper implements TypeMapperInterface
{
/**
* @readonly
* @var \Rector\PHPStanStaticTypeMapper\DoctrineTypeAnalyzer
*/
private $doctrineTypeAnalyzer;
/**
* @readonly
* @var \Rector\Core\Php\PhpVersionProvider
@ -71,9 +65,8 @@ final class UnionTypeMapper implements TypeMapperInterface
* @var \Rector\PHPStanStaticTypeMapper\PHPStanStaticTypeMapper
*/
private $phpStanStaticTypeMapper;
public function __construct(DoctrineTypeAnalyzer $doctrineTypeAnalyzer, PhpVersionProvider $phpVersionProvider, UnionTypeAnalyzer $unionTypeAnalyzer, NodeNameResolver $nodeNameResolver, TypeFactory $typeFactory)
public function __construct(PhpVersionProvider $phpVersionProvider, UnionTypeAnalyzer $unionTypeAnalyzer, NodeNameResolver $nodeNameResolver, TypeFactory $typeFactory)
{
$this->doctrineTypeAnalyzer = $doctrineTypeAnalyzer;
$this->phpVersionProvider = $phpVersionProvider;
$this->unionTypeAnalyzer = $unionTypeAnalyzer;
$this->nodeNameResolver = $nodeNameResolver;
@ -349,10 +342,6 @@ final class UnionTypeMapper implements TypeMapperInterface
*/
private function resolveCompatibleObjectCandidate(UnionType $unionType)
{
if ($this->doctrineTypeAnalyzer->isDoctrineCollectionWithIterableUnionType($unionType)) {
$objectType = new ObjectType('Doctrine\\Common\\Collections\\Collection');
return $this->unionTypeAnalyzer->isNullable($unionType) ? new UnionType([new NullType(), $objectType]) : $objectType;
}
$typesWithClassNames = $this->unionTypeAnalyzer->matchExclusiveTypesWithClassNames($unionType);
if ($typesWithClassNames === []) {
return null;

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'ea3c5045da67b30727c8d9d393729c0838078505';
public const PACKAGE_VERSION = 'fd04aa8db977151cc4147289c3d9b81c1ce53dcf';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-10-09 16:40:22';
public const RELEASE_DATE = '2023-10-10 09:08:21';
/**
* @var int
*/

View File

@ -504,8 +504,8 @@
},
{
"name": "illuminate\/container",
"version": "v10.26.2",
"version_normalized": "10.26.2.0",
"version": "v10.27.0",
"version_normalized": "10.27.0.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/illuminate\/container.git",
@ -561,8 +561,8 @@
},
{
"name": "illuminate\/contracts",
"version": "v10.26.2",
"version_normalized": "10.26.2.0",
"version": "v10.27.0",
"version_normalized": "10.27.0.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/illuminate\/contracts.git",

File diff suppressed because one or more lines are too long