Skip to content

Commit e9c8e19

Browse files
minor symfony#30464 [Debug][DebugClassLoader] Detect annotations before blank docblock lines on final and internal methods (fancyweb)
This PR was merged into the 3.4 branch. Discussion ---------- [Debug][DebugClassLoader] Detect annotations before blank docblock lines on final and internal methods | 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 | - @xabbuh Follow up of symfony#30437 Commits ------- e97ea77 [Debug][DebugClassLoader] Detect annotations before blank docblock lines on final and internal methods
2 parents c5610fa + e97ea77 commit e9c8e19

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Symfony/Component/Debug/DebugClassLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ public function checkAnnotations(\ReflectionClass $refl, $class)
307307
}
308308

309309
foreach (['final', 'internal'] as $annotation) {
310-
if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$)#s', $doc, $notice)) {
310+
if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$|\r?\n)#s', $doc, $notice)) {
311311
$message = isset($notice[1]) ? preg_replace('#\.?\r?\n( \*)? *(?= |\r?\n|$)#', '', $notice[1]) : '';
312312
self::${$annotation.'Methods'}[$class][$method->name] = [$class, $message];
313313
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public function finalMethod()
1313

1414
/**
1515
* @final
16+
*
17+
* @return int
1618
*/
1719
public function finalMethod2()
1820
{

0 commit comments

Comments
 (0)