Skip to content

Commit

Permalink
simplify PHPStanStaticTypeMapper (#3143)
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Dec 2, 2022
1 parent 962dfc6 commit 12ea285
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/PHPStanStaticTypeMapper/PHPStanStaticTypeMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,14 @@ public function mapToPHPStanPhpDocTypeNode(Type $type, string $typeKind): TypeNo
return $typeMapper->mapToPHPStanPhpDocTypeNode($type, $typeKind);
}

if ($type instanceof AccessoryNumericStringType) {
if ($type->isString()->yes()) {
return new IdentifierTypeNode('string');
}

if ($type instanceof HasMethodType) {
return new IdentifierTypeNode('object');
}

if ($type instanceof AccessoryLiteralStringType) {
return new IdentifierTypeNode('string');
}

if ($type instanceof ConditionalType) {
return new IdentifierTypeNode('mixed');
}
Expand Down

0 comments on commit 12ea285

Please sign in to comment.