Просмотр исходного кода

Fix example/description parsing from validation comments

shalvah 3 лет назад
Родитель
Сommit
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];
                 }