Skip to content
Snippets Groups Projects

Replace first occurrence only.

Closed Fran Garcia-Linares requested to merge issue/api-3454780:3454780-see-tags-are into 2.x
1 file
+ 5
1
Compare changes
  • Side-by-side
  • Inline
+ 5
1
@@ -2187,7 +2187,11 @@ class Parser {
$docblock[$property] = '';
while (preg_match('/' . self::RE_TAG_START . $property . '\s(.*?)(?=\n' . self::RE_TAG_START . '|$)/s', $docblock['content'], $matches)) {
$docblock['content'] = str_replace($matches[0], '', $docblock['content']);
// Replace the first occurrence only as similar namespaces could be truncated.
$pos = strpos($docblock['content'], $matches[0]);
if ($pos !== FALSE) {
$docblock['content'] = substr_replace($docblock['content'], '', $pos, strlen($matches[0]));
}
$docblock[$property] .= "\n\n" . $matches[1];
}
$docblock[$property] = Formatter::formatDocumentation($docblock[$property], TRUE, $tmp);
Loading