8000 #17676 - making the proxy instantiation compatible with ProxyManager … · dunglas/symfony@a8f1a10 · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit a8f1a10

Browse files
Ocramiusfabpot
authored andcommitted
symfony#17676 - making the proxy instantiation compatible with ProxyManager 2.x by detecting proxy features
1 parent b9cd91d commit a8f1a10

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@ private function getProxyClassName(Definition $definition)
119119
}
120120

121121
/**
122-
* @param Definition $definition
123-
*
124122
* @return ClassGenerator
125123
*/
126124
private function generateProxyClass(Definition $definition)

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Dumper/PhpDumperTest.php

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

1212
namespace Symfony\Bridge\ProxyManager\Tests\LazyProxy\Dumper;
1313

14+
use ProxyManager\ProxyGenerator\LazyLoading\MethodGenerator\StaticProxyConstructor;
1415
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
1516
use Symfony\Component\DependencyInjection\ContainerBuilder;
1617
use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
@@ -49,8 +50,7 @@ public function testDumpContainerWithProxyService()
4950
*/
5051
public function testDumpContainerWithProxyServiceWillShareProxies()
5152
{
52-
// detecting ProxyManager v2
53-
if (class_exists('ProxyManager\ProxyGenerator\LazyLoading\MethodGenerator\StaticProxyConstructor')) {
53+
if (class_exists(StaticProxyConstructor::class)) { // detecting ProxyManager v2
5454
require_once __DIR__.'/../Fixtures/php/lazy_service_with_hints.php';
5555
} else {
5656
require_once __DIR__.'/../Fixtures/php/lazy_service.php';

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service_with_hints.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@ public function __construct()
3838
public function getFooService($lazyLoad = true)
3939
{
4040
if ($lazyLoad) {
41-
$container = $this;
42-
4341
return $this->services['foo'] = new stdClass_c1d194250ee2e2b7d2eab8b8212368a8(
44-
function (&$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface $proxy) use ($container) {
42+
function (&$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface $proxy) {
4543
$wrappedInstance = $this->getFooService(false);
4644

4745
$proxy->setProxyInitializer(null);

0 commit comments

Comments
 (0)
0