Skip to content

Commit 762e2e1

Browse files
committed
Bugfix: *really* exclude parameters from examples.
1 parent 02fb719 commit 762e2e1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Strategies/BodyParameters/GetFromBodyParamTag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private function getBodyParametersFromDocBlock($tags)
6060
})
6161
->mapWithKeys(function ($tag) {
6262
preg_match('/(.+?)\s+(.+?)\s+(required\s+)?(.*)/', $tag->getContent(), $content);
63-
$content = preg_replace('/\s?No-example.?/', '', $content);
63+
$content = preg_replace('/Example:\s*No-example.?/', '', $content);
6464
if (empty($content)) {
6565
// this means only name and type were supplied
6666
list($name, $type) = preg_split('/\s+/', $tag->getContent());

src/Strategies/QueryParameters/GetFromQueryParamTag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private function getQueryParametersFromDocBlock($tags)
6161
})
6262
->mapWithKeys(function ($tag) {
6363
preg_match('/(.+?)\s+(required\s+)?(.*)/', $tag->getContent(), $content);
64-
$content = preg_replace('/\s?No-example.?/', '', $content);
64+
$content = preg_replace('/Example:\s*No-example.?/', '', $content);
6565
if (empty($content)) {
6666
// this means only name was supplied
6767
list($name) = preg_split('/\s+/', $tag->getContent());

src/Tools/Traits/DocBlockParamHelpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function shouldExcludeExample(Tag $tag)
3333
protected function parseParamDescription(string $description, string $type)
3434
{
3535
$example = null;
36-
if (preg_match('/(.*)\s+Example:\s*(.*)\s*/', $description, $content)) {
36+
if (preg_match('/(.*)\s+Example:\s*(.+)\s*/', $description, $content)) {
3737
$description = $content[1];
3838

3939
// examples are parsed as strings by default, we need to cast them properly

0 commit comments

Comments
 (0)