mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-20 07:22:43 +02:00
Updated Rector to commit 184eb2ed84405c011740792f1fee4e914e11b445
184eb2ed84
[TypeDeclaration] Handle default value with contant type on TypedPropertyFromAssignsRector (#6563)
This commit is contained in:
parent
7f2e323f76
commit
c578222ddf
@ -120,13 +120,10 @@ final class AssignToPropertyTypeInferer
|
||||
return null;
|
||||
}
|
||||
$inferredType = $this->typeFactory->createMixedPassedOrUnionType($assignedExprTypes);
|
||||
// to compare with default value, constant type must not be kept
|
||||
// eg, use more general bool over false or true
|
||||
if ($this->shouldSkipWithDifferentDefaultValueType($defaultPropertyValue, $inferredType)) {
|
||||
return null;
|
||||
}
|
||||
// returns with constant as final result
|
||||
return $this->typeFactory->createMixedPassedOrUnionType($assignedExprTypes, \true);
|
||||
return $inferredType;
|
||||
}
|
||||
private function shouldSkipWithDifferentDefaultValueType(?Expr $expr, Type $inferredType) : bool
|
||||
{
|
||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '457927353525b5f87771493eaa7f79523383b071';
|
||||
public const PACKAGE_VERSION = '184eb2ed84405c011740792f1fee4e914e11b445';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-12-12 07:46:01';
|
||||
public const RELEASE_DATE = '2024-12-12 08:12:34';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user