Skip to content

Commit 9d79113

Browse files
committed
bug symfony#30437 [Debug] detect annotations before blank docblock lines (xabbuh)
This PR was merged into the 3.4 branch. Discussion ---------- [Debug] detect annotations before blank docblock lines | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | This fixes the tests and a small issue after the CS changes made in df1d50d for symfony#29920. Commits ------- dedd526 detect annotations before blank docblock lines
2 parents e3c0878 + dedd526 commit 9d79113

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/Symfony/Component/Debug/DebugClassLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public function checkAnnotations(\ReflectionClass $refl, $class)
233233
// Detect annotations on the class
234234
if (false !== $doc = $refl->getDocComment()) {
235235
foreach (['final', 'deprecated', 'internal'] as $annotation) {
236-
if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$)#s', $doc, $notice)) {
236+
if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$|\r?\n)#s', $doc, $notice)) {
237237
self::${$annotation}[$class] = isset($notice[1]) ? preg_replace('#\.?\r?\n( \*)? *(?= |\r?\n|$)#', '', $notice[1]) : '';
238238
}
239239
}

src/Symfony/Component/Debug/Tests/Fixtures/FinalClasses.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class FinalClass6
6464
* @author John Doe
6565
*
6666
* @final another
67-
*
6867
* multiline comment...
6968
*
7069
* @return string

0 commit comments

Comments
 (0)