public function getDocType(array $importedNamespaces = array()) { if ($this->elementType->isUnknownType() || $this->elementType->isAllType()) { return 'array'; } if ($this->keyType->isIntegerType()) { return 'array<' . $this->elementType->getDocType($importedNamespaces) . '>'; // TODO: Should we optionally allow PHPDocumentor style below? // $elementDocType = $this->elementType->getDocType($importedNamespaces); // // // For unions, PHP documentor supports "(int|string)[]". // if ($this->elementType->isUnionType()) { // $elementDocType = '('.$elementDocType.')'; // } // // return $elementDocType.'[]'; } if ($this->keyType->isStringType()) { return 'array<string,' . $this->elementType->getDocType($importedNamespaces) . '>'; } return 'array<*,' . $this->elementType->getDocType($importedNamespaces) . '>'; }