Skip to content
This repository was archived by the owner on Dec 29, 2020. It is now read-only.

Commit 7f7bed4

Browse files
committed
Merge pull request #9 from mfn/array-without-types
converter: convert any scalar array declaration to pure array
2 parents 6b28c41 + 80b53b5 commit 7f7bed4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Converter.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use phpDocumentor\Reflection\Php\File;
2121
use phpDocumentor\Reflection\Php\Interface_;
2222
use phpDocumentor\Reflection\Php\Project;
23+
use phpDocumentor\Reflection\Types\Array_;
2324
use phpDocumentor\Reflection\Types\Compound;
2425
use phpDocumentor\Reflection\Types\Null_;
2526

@@ -486,6 +487,12 @@ private function getType(Tag $tag): array
486487
return [];
487488
}
488489

490+
if ($type instanceof Array_) {
491+
// May contain more specific type declarations, but we only
492+
// convert to pure arrays
493+
return ['array', false];
494+
}
495+
489496
return [$type->__toString(), false];
490497
}
491498

0 commit comments

Comments
 (0)