Skip to content

Commit 7af2216

Browse files
committed
Updated Rector to commit 95a145f9311826749ea9e72f44c3a3adb2a030f3
rectorphp/rector-src@95a145f [DeadCode] Skip union falsy mixed on trait on RecastingRemovalRector (#6718)
1 parent e3da0f3 commit 7af2216

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

rules/DeadCode/Rector/Cast/RecastingRemovalRector.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use PHPStan\Type\ObjectType;
2525
use PHPStan\Type\StringType;
2626
use PHPStan\Type\Type;
27+
use PHPStan\Type\UnionType;
2728
use Rector\NodeAnalyzer\ExprAnalyzer;
2829
use Rector\NodeAnalyzer\PropertyFetchAnalyzer;
2930
use Rector\Rector\AbstractRector;
@@ -126,6 +127,14 @@ private function shouldSkipCall(Expr $expr) : bool
126127
}
127128
private function shouldSkip(Expr $expr) : bool
128129
{
130+
$type = $this->getType($expr);
131+
if ($type instanceof UnionType) {
132+
foreach ($type->getTypes() as $unionedType) {
133+
if ($unionedType instanceof MixedType) {
134+
return \true;
135+
}
136+
}
137+
}
129138
if (!$this->propertyFetchAnalyzer->isPropertyFetch($expr)) {
130139
return $this->exprAnalyzer->isNonTypedFromParam($expr);
131140
}

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 = 'a4c489ee0914233600f93379edee4932ce2d4ee4';
22+
public const PACKAGE_VERSION = '95a145f9311826749ea9e72f44c3a3adb2a030f3';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2025-02-05 11:37:04';
27+
public const RELEASE_DATE = '2025-02-05 15:47:13';
2828
/**
2929
* @var int
3030
*/

0 commit comments

Comments
 (0)