#502 Hide Requirement when not set

This commit is contained in:
Denys Pasishnyi 2016-06-13 00:29:59 +02:00
parent a009e97382
commit 725e4d9dda

View File

@ -56,11 +56,15 @@ class FosRestHandler implements HandlerInterface
'description' => $annot->description, 'description' => $annot->description,
'default' => $annot->default, 'default' => $annot->default,
)); ));
} else { } elseif ($annot->requirements !== null) {
$annotation->addFilter($annot->name, array( $annotation->addFilter($annot->name, array(
'requirement' => $this->handleRequirements($annot->requirements).((property_exists($annot, 'map') ? $annot->map : $annot->array) ? '[]' : ''), 'requirement' => $this->handleRequirements($annot->requirements).((property_exists($annot, 'map') ? $annot->map : $annot->array) ? '[]' : ''),
'description' => $annot->description, 'description' => $annot->description,
)); ));
} else {
$annotation->addFilter($annot->name, array(
'description' => $annot->description,
));
} }
} }
} }