mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-04-03 22:03:33 +03:00
Update PhpDocHandler.php
https://github.com/nelmio/NelmioApiDocBundle/issues/477
This commit is contained in:
parent
bc1d3f6f7f
commit
3e6a47818e
1 changed files with 10 additions and 3 deletions
|
@ -83,10 +83,17 @@ class PhpDocHandler implements HandlerInterface
|
|||
$found = false;
|
||||
foreach ($paramDocs as $paramDoc) {
|
||||
if (preg_match(sprintf($regexp, preg_quote($var)), $paramDoc, $matches)) {
|
||||
$requirements[$var]['dataType'] = isset($matches[1]) ? $matches[1] : '';
|
||||
$requirements[$var]['description'] = $matches[2];
|
||||
$annotationRequirements = $annotation->getrequirements();
|
||||
|
||||
if (!isset($requirements[$var]['requirement'])) {
|
||||
if (!isset($annotationRequirements[$var]['dataType'])) {
|
||||
$requirements[$var]['dataType'] = isset($matches[1]) ? $matches[1] : '';
|
||||
}
|
||||
|
||||
if (!isset($annotationRequirements[$var]['description'])) {
|
||||
$requirements[$var]['description'] = $matches[2];
|
||||
}
|
||||
|
||||
if (!isset($requirements[$var]['requirement']) && !isset($annotationRequirements[$var]['requirement'])) {
|
||||
$requirements[$var]['requirement'] = '';
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue