mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Updated code to pass the tests
This commit is contained in:
parent
f247d6af92
commit
07e6a19dd4
@ -233,7 +233,7 @@ class ApiDocExtractor
|
|||||||
$comment = preg_replace('/^\s*\* ?/m', '', $comment);
|
$comment = preg_replace('/^\s*\* ?/m', '', $comment);
|
||||||
|
|
||||||
// Remove everything (and including) first annotation
|
// Remove everything (and including) first annotation
|
||||||
$comment = preg_replace('/\n?\s*@[^\s]+.+/ms', '', $comment);
|
$comment = preg_replace('/@[\w0-9]+\(.*/msi', '', $comment);
|
||||||
|
|
||||||
return trim($comment);
|
return trim($comment);
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,10 @@ class MarkdownFormatter extends AbstractFormatter
|
|||||||
$markdown .= "#### Documentation ####\n\n";
|
$markdown .= "#### Documentation ####\n\n";
|
||||||
|
|
||||||
foreach (explode("\n", $data['documentation']) as $line) {
|
foreach (explode("\n", $data['documentation']) as $line) {
|
||||||
$markdown .= "\t" . $line . "\n";
|
$markdown .= " " . $line . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$markdown .= "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($data['requirements']) && !empty($data['requirements'])) {
|
if (isset($data['requirements']) && !empty($data['requirements'])) {
|
||||||
|
@ -126,6 +126,11 @@ _Action without HTTP verb_
|
|||||||
|
|
||||||
_This method is useful to test if the getDocComment works. And, it supports multilines until the first '@' char._
|
_This method is useful to test if the getDocComment works. And, it supports multilines until the first '@' char._
|
||||||
|
|
||||||
|
#### Documentation ####
|
||||||
|
|
||||||
|
This method is useful to test if the getDocComment works.
|
||||||
|
And, it supports multilines until the first '@' char.
|
||||||
|
|
||||||
#### Requirements ####
|
#### Requirements ####
|
||||||
|
|
||||||
**id**
|
**id**
|
||||||
|
@ -168,6 +168,7 @@ class SimpleFormatterTest extends WebTestCase
|
|||||||
'page' => array('type' => 'int', 'description' => '', 'value' => ''),
|
'page' => array('type' => 'int', 'description' => '', 'value' => ''),
|
||||||
),
|
),
|
||||||
'description' => 'This method is useful to test if the getDocComment works. And, it supports multilines until the first \'@\' char.',
|
'description' => 'This method is useful to test if the getDocComment works. And, it supports multilines until the first \'@\' char.',
|
||||||
|
'documentation' => "This method is useful to test if the getDocComment works.\nAnd, it supports multilines until the first '@' char."
|
||||||
),
|
),
|
||||||
3 =>
|
3 =>
|
||||||
array(
|
array(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user