Skip to content

Commit

Permalink
[Debug][DebugClassLoader] Detect annotations before blank docblock li…
Browse files Browse the repository at this point in the history
…nes on final and internal methods
  • Loading branch information
fancyweb committed Mar 6, 2019
1 parent c5610fa commit e97ea77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Debug/DebugClassLoader.php
Expand Up @@ -307,7 +307,7 @@ public function checkAnnotations(\ReflectionClass $refl, $class)
}

foreach (['final', 'internal'] as $annotation) {
if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$)#s', $doc, $notice)) {
if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$|\r?\n)#s', $doc, $notice)) {
$message = isset($notice[1]) ? preg_replace('#\.?\r?\n( \*)? *(?= |\r?\n|$)#', '', $notice[1]) : '';
self::${$annotation.'Methods'}[$class][$method->name] = [$class, $message];
}
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/Debug/Tests/Fixtures/FinalMethod.php
Expand Up @@ -13,6 +13,8 @@ public function finalMethod()

/**
* @final
*
* @return int
*/
public function finalMethod2()
{
Expand Down

0 comments on commit e97ea77

Please sign in to comment.