Skip to content

Commit

Permalink
Merge pull request #11 from sj-i/untyped-array
Browse files Browse the repository at this point in the history
support untyped array
  • Loading branch information
sj-i committed Sep 2, 2021
2 parents 5ec9002 + ca319fa commit fe3da54
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/PhpDocTypeReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ private function getTypeFromNodeType(TypeNode $type_node, IdentifierContext $ide
return new BoolType();
case 'null':
return new NullType();
case 'array':
return new ArrayType(new MixedType());
default:
return new ObjectType(
$this->tryGetClassNameFromIdentifier($type_node, $identifier_context)
Expand Down
7 changes: 7 additions & 0 deletions tests/PhpDocTypeReaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,13 @@ public function paramProvider()
'/** @param array<mixed> $mixed_array_var */',
$default_identifier_context,
],
[
[
'untyed_array_var' => new ArrayType(new MixedType()),
],
'/** @param array $untyed_array_var */',
$default_identifier_context,
],
[
[
'int_key_array_var' => new ArrayType(new MixedType(), new IntType()),
Expand Down

0 comments on commit fe3da54

Please sign in to comment.