Skip to content

Commit

Permalink
Updated Rector to commit 95a145f9311826749ea9e72f44c3a3adb2a030f3
Browse files Browse the repository at this point in the history
rectorphp/rector-src@95a145f [DeadCode] Skip union falsy mixed on trait on RecastingRemovalRector (#6718)
  • Loading branch information
TomasVotruba committed Feb 5, 2025
1 parent e3da0f3 commit 7af2216
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions rules/DeadCode/Rector/Cast/RecastingRemovalRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use PHPStan\Type\ObjectType;
use PHPStan\Type\StringType;
use PHPStan\Type\Type;
use PHPStan\Type\UnionType;
use Rector\NodeAnalyzer\ExprAnalyzer;
use Rector\NodeAnalyzer\PropertyFetchAnalyzer;
use Rector\Rector\AbstractRector;
Expand Down Expand Up @@ -126,6 +127,14 @@ private function shouldSkipCall(Expr $expr) : bool
}
private function shouldSkip(Expr $expr) : bool
{
$type = $this->getType($expr);
if ($type instanceof UnionType) {
foreach ($type->getTypes() as $unionedType) {
if ($unionedType instanceof MixedType) {
return \true;
}
}
}
if (!$this->propertyFetchAnalyzer->isPropertyFetch($expr)) {
return $this->exprAnalyzer->isNonTypedFromParam($expr);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'a4c489ee0914233600f93379edee4932ce2d4ee4';
public const PACKAGE_VERSION = '95a145f9311826749ea9e72f44c3a3adb2a030f3';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2025-02-05 11:37:04';
public const RELEASE_DATE = '2025-02-05 15:47:13';
/**
* @var int
*/
Expand Down

0 comments on commit 7af2216

Please # to comment.