mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
fix jms metadata parser for hashmaps: array<K, V>
This commit is contained in:
parent
00bcdc927e
commit
d2cd56dafc
@ -181,12 +181,15 @@ class JmsMetadataParser implements ParserInterface
|
|||||||
*/
|
*/
|
||||||
protected function getNestedTypeInArray(PropertyMetadata $item)
|
protected function getNestedTypeInArray(PropertyMetadata $item)
|
||||||
{
|
{
|
||||||
if (is_array($item->type)
|
if (isset($item->type['name']) && in_array($item->type['name'], array('array', 'ArrayCollection'))) {
|
||||||
&& in_array($item->type['name'], array('array', 'ArrayCollection'))
|
if (isset($item->type['params'][1]['name'])) {
|
||||||
&& isset($item->type['params'])
|
// E.g. array<string, MyNamespaceMyObject>
|
||||||
&& 1 === count($item->type['params'])
|
return $item->type['params'][1]['name'];
|
||||||
&& isset($item->type['params'][0]['name'])) {
|
}
|
||||||
return $item->type['params'][0]['name'];
|
if (isset($item->type['params'][0]['name'])) {
|
||||||
|
// E.g. array<MyNamespaceMyObject>
|
||||||
|
return $item->type['params'][0]['name'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user