propertyDescribers = $propertyDescribers; } public function describe(Type $type, Schema $property, array $groups = null) { $type = $type->getCollectionValueType(); if (null === $type) { throw new UndocumentedArrayItemsException(); } $property->setType('array'); $property = $property->getItems(); foreach ($this->propertyDescribers as $propertyDescriber) { if ($propertyDescriber instanceof ModelRegistryAwareInterface) { $propertyDescriber->setModelRegistry($this->modelRegistry); } if ($propertyDescriber->supports($type)) { try { $propertyDescriber->describe($type, $property, $groups); } catch (UndocumentedArrayItemsException $e) { if (null !== $e->getClass()) { throw $e; // This exception is already complete } throw new UndocumentedArrayItemsException(null, sprintf("%s[]", $e->getPath())); } break; } } } public function supports(Type $type): bool { return $type->isCollection(); } }