Skip to content

Commit e97ea77

Browse files
committed
[Debug][DebugClassLoader] Detect annotations before blank docblock lines on final and internal methods
1 parent c5610fa commit e97ea77

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)