浏览代码

Fix example/description parsing from validation comments

shalvah 3 年之前
父节点
当前提交
e3b7dbefc1
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Extracting/Strategies/GetFromInlineValidatorBase.php

+ 1 - 1
src/Extracting/Strategies/GetFromInlineValidatorBase.php

@@ -122,7 +122,7 @@ class GetFromInlineValidatorBase extends Strategy
             if ($comments) {
                 $description = trim(str_replace(['No-example.', 'No-example'], '', $comments));
                 $example = null;
-                if (preg_match('/(.*\s+|^)Example:\s*([\s\S]+)\s*/m', $description, $matches)) {
+                if (preg_match('/(.*\s+|^)Example:\s*([\s\S]+)\s*/s', $description, $matches)) {
                     $description = trim($matches[1]);
                     $example = $matches[2];
                 }