Skip to content

Commit

Permalink
AnnotationExtractor: fix tests on windows (#111)
Browse files Browse the repository at this point in the history
Co-authored-by: Markus Staab <[email protected]>
  • Loading branch information
staabm and clxmstaab authored May 30, 2021
1 parent 223ad8f commit b42fc3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/ChangesReporting/Annotation/AnnotationExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ public function extractAnnotationFromClass(string $className, string $annotation
return null;
}

// @see https://regex101.com/r/oYGaWU/1
$pattern = '#' . preg_quote($annotation, '#') . '\s+(?<content>.*?)$#m';
// @see https://3v4l.org/ouYfB
// uses '\r?\n' instead of '$' because windows compat
$pattern = '#' . preg_quote($annotation, '#') . '\s+(?<content>.*?)\r?\n#m';
$matches = Strings::match($docComment, $pattern);

return $matches['content'] ?? null;
}
}

0 comments on commit b42fc3d

Please sign in to comment.