8000 [Bridge/ProxyManager] Remove direct reference to value holder property · symfony/symfony@af9d644 · GitHub
[go: up one dir, main page]

Skip to content

Commit af9d644

Browse files
[Bridge/ProxyManager] Remove direct reference to value holder property
1 parent 85f7cc8 commit af9d644

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ function (&\$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface \$proxy)
9393
*/
9494
public function getProxyCode(Definition $definition)
9595
{
96-
return $this->classGenerator->generate($this->generateProxyClass($definition));
96+
return preg_replace(
97+
'/(\$this->initializer[0-9a-f]++) && \1->__invoke\(\$this->(valueHolder[0-9a-f]++), (.*?), \1\);/',
98+
'$1 && ($1->__invoke(\$$2, $3, $1) || 1) && $this->$2 = \$$2;',
99+
$this->classGenerator->generate($this->generateProxyClass($definition))
100+
);
97101
}
98102

99103
/**

0 commit comments

Comments
 (0)
0