8000 [ErrorHandler] Skip "same vendor" `@method` deprecations for `Symfony… · symfony/symfony@7e82b57 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7e82b57

Browse files
[ErrorHandler] Skip "same vendor" @method deprecations for Symfony\* classes unless symfony/symfony is being used
1 parent 30dd608 commit 7e82b57

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Symfony/Component/ErrorHandler/DebugClassLoader.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\ErrorHandler;
1313

14+
use Composer\InstalledVersions;
1415
use Doctrine\Common\Persistence\Proxy as LegacyProxy;
1516
use Doctrine\Persistence\Proxy;
1617
use Mockery\MockInterface;
@@ -492,6 +493,13 @@ public function checkAnnotations(\ReflectionClass $refl, string $class): array
492493
self::$method[$class] = self::$method[$use];
493494
}
494495
} elseif (!$refl->isInterface()) {
496+
if (!strncmp($vendor, str_replace('_', '\\', $use), $vendorLen)
497+
&& 0 === strpos($className, 'Symfony\\')
498+
&& class_exists(InstalledVersions::class)
499+
&& 'symfony/symfony' !== InstalledVersions::getRootPackage()['name']
500+
) {
501+
continue; // skip "same vendor" @method deprecations for Symfony\* classes unless symfony/symfony is being used
502+
}
495503
$hasCall = $refl->hasMethod('__call');
496504
$hasStaticCall = $refl->hasMethod('__callStatic');
497505
foreach (self::$method[$use] as $method) {

0 commit comments

Comments
 (0)
0