bug #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 indf1d50dcc2
for #29920. Commits -------dedd526b19
detect annotations before blank docblock lines
This commit is contained in:
commit
9d791132d9
@ -233,7 +233,7 @@ class DebugClassLoader
|
|||||||
// Detect annotations on the class
|
// Detect annotations on the class
|
||||||
if (false !== $doc = $refl->getDocComment()) {
|
if (false !== $doc = $refl->getDocComment()) {
|
||||||
foreach (['final', 'deprecated', 'internal'] as $annotation) {
|
foreach (['final', 'deprecated', '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)) {
|
||||||
self::${$annotation}[$class] = isset($notice[1]) ? preg_replace('#\.?\r?\n( \*)? *(?= |\r?\n|$)#', '', $notice[1]) : '';
|
self::${$annotation}[$class] = isset($notice[1]) ? preg_replace('#\.?\r?\n( \*)? *(?= |\r?\n|$)#', '', $notice[1]) : '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,6 @@ class FinalClass6
|
|||||||
* @author John Doe
|
* @author John Doe
|
||||||
*
|
*
|
||||||
* @final another
|
* @final another
|
||||||
*
|
|
||||||
* multiline comment...
|
* multiline comment...
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
|
Reference in New Issue
Block a user