Skip to content

Commit 61db165

Browse files
authored
[TypeMapper] Use Identifier instead of Name on bool and null (rectorphp#3378)
1 parent 56e1633 commit 61db165

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/PHPStanStaticTypeMapper/TypeMapper/UnionTypeMapper.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function mapToPhpParserNode(Type $type, string $typeKind): ?Node
107107
if ($this->boolUnionTypeAnalyzer->isNullableBoolUnionType($type)
108108
&& ! $this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::UNION_TYPES)
109109
) {
110-
return $this->resolveNullableType(new NullableType(new Name('bool')));
110+
return $this->resolveNullableType(new NullableType(new Identifier('bool')));
111111
}
112112

113113
if (! $this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::UNION_TYPES) && $this->isFalseBoolUnion(
@@ -360,7 +360,7 @@ private function matchPhpParserUnionType(
360360
* @var Identifier|Name|null|PHPParserNodeIntersectionType $phpParserNode
361361
*/
362362
$phpParserNode = $unionedType instanceof NullType && $typeKind === TypeKind::PROPERTY
363-
? new Name('null')
363+
? new Identifier('null')
364364
: $this->phpStanStaticTypeMapper->mapToPhpParserNode($unionedType, $typeKind);
365365

366366
if ($phpParserNode === null) {

0 commit comments

Comments
 (0)