bug #24570 [Debug] Fix same vendor detection in class loader (Jean-Beru)
This PR was merged into the 2.7 branch.
Discussion
----------
[Debug] Fix same vendor detection in class loader
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Fix about same vendor detection in ClassLoader. Actually, detected namespace for `Doctrine\ORM\Configuration` is `Doctrine\ORM` instead of `Doctrine\`. So deprecations are triggered for classes in same namespace.
Commits
-------
d2ab0d8019
[Debug] Fix same vendor detection in class loader
This commit is contained in:
commit
ff459928c9
|
@ -203,18 +203,11 @@ class DebugClassLoader
|
||||||
} elseif (preg_match('#\n \* @deprecated (.*?)\r?\n \*(?: @|/$)#s', $refl->getDocComment(), $notice)) {
|
} elseif (preg_match('#\n \* @deprecated (.*?)\r?\n \*(?: @|/$)#s', $refl->getDocComment(), $notice)) {
|
||||||
self::$deprecated[$name] = preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]);
|
self::$deprecated[$name] = preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]);
|
||||||
} else {
|
} else {
|
||||||
if (2 > $len = 1 + (strpos($name, '\\', 1 + strpos($name, '\\')) ?: strpos($name, '_'))) {
|
if (2 > $len = 1 + (strpos($name, '\\') ?: strpos($name, '_'))) {
|
||||||
$len = 0;
|
$len = 0;
|
||||||
$ns = '';
|
$ns = '';
|
||||||
} else {
|
} else {
|
||||||
switch ($ns = substr($name, 0, $len)) {
|
$ns = substr($name, 0, $len);
|
||||||
case 'Symfony\Bridge\\':
|
|
||||||
case 'Symfony\Bundle\\':
|
|
||||||
case 'Symfony\Component\\':
|
|
||||||
$ns = 'Symfony\\';
|
|
||||||
$len = strlen($ns);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$parent = get_parent_class($class);
|
$parent = get_parent_class($class);
|
||||||
|
|
||||||
|
|
Reference in New Issue