summaryrefslogtreecommitdiff
path: root/vendor/symfony/debug
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/debug')
-rw-r--r--vendor/symfony/debug/DebugClassLoader.php6
-rw-r--r--vendor/symfony/debug/Tests/Fixtures/FinalClasses.php3
-rw-r--r--vendor/symfony/debug/Tests/Fixtures/FinalMethod.php2
3 files changed, 7 insertions, 4 deletions
diff --git a/vendor/symfony/debug/DebugClassLoader.php b/vendor/symfony/debug/DebugClassLoader.php
index 2816c4fba7..e648bf60c5 100644
--- a/vendor/symfony/debug/DebugClassLoader.php
+++ b/vendor/symfony/debug/DebugClassLoader.php
@@ -232,7 +232,7 @@ class DebugClassLoader
// Detect annotations on the class
if (false !== $doc = $refl->getDocComment()) {
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]) : '';
}
}
@@ -257,7 +257,7 @@ class DebugClassLoader
if (!isset(self::$checkedClasses[$use])) {
$this->checkClass($use);
}
- if (isset(self::$deprecated[$use]) && \strncmp($ns, \str_replace('_', '\\', $use), $len)) {
+ if (isset(self::$deprecated[$use]) && \strncmp($ns, \str_replace('_', '\\', $use), $len) && !isset(self::$deprecated[$class])) {
$type = class_exists($class, false) ? 'class' : (interface_exists($class, false) ? 'interface' : 'trait');
$verb = class_exists($use, false) || interface_exists($class, false) ? 'extends' : (interface_exists($use, false) ? 'implements' : 'uses');
@@ -324,7 +324,7 @@ class DebugClassLoader
$finalOrInternal = false;
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];
$finalOrInternal = true;
diff --git a/vendor/symfony/debug/Tests/Fixtures/FinalClasses.php b/vendor/symfony/debug/Tests/Fixtures/FinalClasses.php
index 0f51f9f46f..4c2b0aaf35 100644
--- a/vendor/symfony/debug/Tests/Fixtures/FinalClasses.php
+++ b/vendor/symfony/debug/Tests/Fixtures/FinalClasses.php
@@ -30,6 +30,7 @@ class FinalClass3
/**
* @final
+ *
* @author John Doe
*/
class FinalClass4
@@ -63,7 +64,6 @@ class FinalClass6
* @author John Doe
*
* @final another
- *
* multiline comment...
*
* @return string
@@ -76,6 +76,7 @@ class FinalClass7
/**
* @author John Doe
* @final
+ *
* @return string
*/
class FinalClass8
diff --git a/vendor/symfony/debug/Tests/Fixtures/FinalMethod.php b/vendor/symfony/debug/Tests/Fixtures/FinalMethod.php
index 03e47e8a7a..60a28b24c2 100644
--- a/vendor/symfony/debug/Tests/Fixtures/FinalMethod.php
+++ b/vendor/symfony/debug/Tests/Fixtures/FinalMethod.php
@@ -13,6 +13,8 @@ class FinalMethod
/**
* @final
+ *
+ * @return int
*/
public function finalMethod2()
{