Skip to content

Commit

Permalink
[Php74] Remove TemplateType check on TypedPropertyRector (#1826)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Feb 17, 2022
1 parent 4cf6522 commit 0f3363c
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions rules/Php74/Rector/Property/TypedPropertyRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use PhpParser\Node\Stmt\Trait_;
use PHPStan\Analyser\Scope;
use PHPStan\Reflection\ClassReflection;
use PHPStan\Type\Generic\TemplateType;
use PHPStan\Type\MixedType;
use PHPStan\Type\NullType;
use PHPStan\Type\Type;
Expand Down Expand Up @@ -141,21 +140,6 @@ public function refactor(Node $node): ?Node
return null;
}

if ($varType instanceof UnionType) {
$types = $varType->getTypes();

if (count($types) === 2 && $types[1] instanceof TemplateType) {
$templateType = $types[1];

$node->type = $this->staticTypeMapper->mapPHPStanTypeToPhpParserNode(
$templateType->getBound(),
TypeKind::PROPERTY()
);

return $node;
}
}

if ($this->objectTypeAnalyzer->isSpecial($varType)) {
return null;
}
Expand Down

0 comments on commit 0f3363c

Please sign in to comment.