|
11 | 11 |
|
12 | 12 | namespace Symfony\Component\ErrorHandler;
|
13 | 13 |
|
| 14 | +use Composer\InstalledVersions; |
14 | 15 | use Doctrine\Common\Persistence\Proxy as LegacyProxy;
|
15 | 16 | use Doctrine\Persistence\Proxy;
|
16 | 17 | use Mockery\MockInterface;
|
@@ -183,6 +184,7 @@ class DebugClassLoader
|
183 | 184 |
|
184 | 185 | public function __construct(callable $classLoader)
|
185 | 186 | {
|
| 187 | + class_exists(InstalledVersions::class); |
186 | 188 | $this->classLoader = $classLoader;
|
187 | 189 | $this->isFinder = \is_array($classLoader) && method_exists($classLoader[0], 'findFile');
|
188 | 190 | parse_str(getenv('SYMFONY_PATCH_TYPE_DECLARATIONS') ?: '', $this->patchTypes);
|
@@ -492,6 +494,13 @@ public function checkAnnotations(\ReflectionClass $refl, string $class): array
|
492 | 494 | self::$method[$class] = self::$method[$use];
|
493 | 495 | }
|
494 | 496 | } elseif (!$refl->isInterface()) {
|
| 497 | + if (!strncmp($vendor, str_replace('_', '\\', $use), $vendorLen) |
| 498 | + && class_exists(InstalledVersions::class, false) |
| 499 | + && 0 === strpos($root = InstalledVersions::getRootPackage()['name'], 'symfony/') |
| 500 | + && 'symfony/symfony' !== $root |
| 501 | + ) { |
| 502 | + continue; // skip @method deprecations for symfony/* packages, but for symfony/symfony |
| 503 | + } |
495 | 504 | $hasCall = $refl->hasMethod('__call');
|
496 | 505 | $hasStaticCall = $refl->hasMethod('__callStatic');
|
497 | 506 | foreach (self::$method[$use] as $method) {
|
|
0 commit comments