8000 bug #41075 [ErrorHandler] Skip "same vendor" ``@method`` deprecations… · symfony/symfony@88dcf52 · GitHub
[go: up one dir, main page]

Skip to content

Commit 88dcf52

Browse files
committed
bug #41075 [ErrorHandler] Skip "same vendor" @method deprecations for Symfony\* classes unless symfony/symfony is being tested (nicolas-grekas)
This PR was merged into the 4.4 branch. Discussion ---------- [ErrorHandler] Skip "same vendor" ``@method`` deprecations for `Symfony\*` classes unless symfony/symfony is being tested | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | ref #40975 #40996 #40893 | License | MIT | Doc PR | Replaces #41001 Commits ------- 7a1a910 [ErrorHandler] Skip "same vendor" ``@method`` deprecations for `Symfony\*` classes unless symfony/symfony is being tested
2 parents 2f3519b + 7a1a910 commit 88dcf52

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Symfony/Component/ErrorHandler/DebugClassLoader.php

Lines changed: 9 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,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)
0