Skip to content

Commit 7a1a910

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

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Symfony/Component/ErrorHandler/DebugClassLoader.php

+9
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,14 @@ 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+
// skip "same vendor" @method deprecations for Symfony\* classes unless symfony/symfony is being tested
502+
continue;
503+
}
495504
$hasCall = $refl->hasMethod('__call');
496505
$hasStaticCall = $refl->hasMethod('__callStatic');
497506
foreach (self::$method[$use] as $method) {

0 commit comments

Comments
 (0)