Skip to content
Permalink
Browse files

minor #30464 [Debug][DebugClassLoader] Detect annotations before blan…

…k 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 #30437

Commits
-------

e97ea77 [Debug][DebugClassLoader] Detect annotations before blank docblock lines on final and internal methods
  • Loading branch information...
nicolas-grekas committed Mar 7, 2019
2 parents c5610fa + e97ea77 commit e9c8e19f46728fef1f8640a8e9fda074e1080f76
@@ -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];
}
@@ -13,6 +13,8 @@ public function finalMethod()
/**
* @final
*
* @return int
*/
public function finalMethod2()
{

0 comments on commit e9c8e19

Please sign in to comment.
You can’t perform that action at this time.