Skip to content

Commit d9df93d

Browse files
committed
Updated Rector to commit 9450ef9233da2d735754ed380885129aee1774ae
rectorphp/rector-src@9450ef9 fix: SafeDeclareStrictTypesRector (#7856)
1 parent fad0279 commit d9df93d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

rules/TypeDeclaration/NodeAnalyzer/StrictTypeSafetyChecker.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use PHPStan\Reflection\Php\PhpPropertyReflection;
1818
use PHPStan\Type\MixedType;
1919
use PHPStan\Type\NeverType;
20+
use PHPStan\Type\StrictMixedType;
2021
use PHPStan\Type\Type;
2122
use Rector\NodeTypeResolver\NodeTypeResolver;
2223
use Rector\NodeTypeResolver\PHPStan\ParametersAcceptorSelectorVariantsWrapper;
@@ -173,6 +174,10 @@ private function isPropertyAssignSafe(Assign $assign): bool
173174
}
174175
private function isTypeSafeForStrictMode(Type $declaredType, Type $valueType): bool
175176
{
177+
// need to be strict with mixed to avoid false positives
178+
if ($valueType instanceof MixedType) {
179+
$valueType = new StrictMixedType();
180+
}
176181
return $declaredType->accepts($valueType, \true)->yes();
177182
}
178183
}

src/Application/VersionResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = '0a5ae872786600d59a93e719f634603e852addec';
22+
public const PACKAGE_VERSION = '9450ef9233da2d735754ed380885129aee1774ae';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2026-01-22 00:58:10';
27+
public const RELEASE_DATE = '2026-01-22 13:35:33';
2828
/**
2929
* @var int
3030
*/

0 commit comments

Comments
 (0)