Skip to content

Commit

Permalink
bug #41075 [ErrorHandler] Skip "same vendor" @method deprecations…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
derrabus committed May 3, 2021
2 parents 2f3519b + 7a1a910 commit 88dcf52
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Symfony/Component/ErrorHandler/DebugClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\ErrorHandler;

use Composer\InstalledVersions;
use Doctrine\Common\Persistence\Proxy as LegacyProxy;
use Doctrine\Persistence\Proxy;
use Mockery\MockInterface;
Expand Down Expand Up @@ -492,6 +493,14 @@ public function checkAnnotations(\ReflectionClass $refl, string $class): array
self::$method[$class] = self::$method[$use];
}
} elseif (!$refl->isInterface()) {
if (!strncmp($vendor, str_replace('_', '\\', $use), $vendorLen)
&& 0 === strpos($className, 'Symfony\\')
&& (!class_exists(InstalledVersions::class)
|| 'symfony/symfony' !== InstalledVersions::getRootPackage()['name'])
) {
// skip "same vendor" @method deprecations for Symfony\* classes unless symfony/symfony is being tested
continue;
}
$hasCall = $refl->hasMethod('__call');
$hasStaticCall = $refl->hasMethod('__callStatic');
foreach (self::$method[$use] as $method) {
Expand Down

0 comments on commit 88dcf52

Please sign in to comment.