/**
* Computes the documentation.
*
* @param Documentation $object
* @param array $classes
*
* @return array
*/
private function computeDoc(Documentation $object, array $classes) : array
{
$doc = ['@context' => $this->getContext(), '@id' => $this->urlGenerator->generate('api_doc', ['_format' => self::FORMAT])];
if ('' !== $object->getTitle()) {
$doc['hydra:title'] = $object->getTitle();
}
if ('' !== $object->getDescription()) {
$doc['hydra:description'] = $object->getDescription();
}
$doc['hydra:entrypoint'] = $this->urlGenerator->generate('api_entrypoint');
$doc['hydra:supportedClass'] = $classes;
return $doc;
}