8000 bug #24906 [Bridge/ProxyManager] Remove direct reference to value hol… · symfony/symfony@ae65bd8 · GitHub
[go: up one dir, main page]

Skip to content

Commit ae65bd8

Browse files
committed
bug #24906 [Bridge/ProxyManager] Remove direct reference to value holder property (nicolas-grekas)
This PR was merged into the 2.7 branch. Discussion ---------- [Bridge/ProxyManager] Remove direct reference to value holder property | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #23110 | License | MIT | Doc PR | - This fixes Ocramius/ProxyManager#394 on Symfony's side, because proxy-manager v1 is not maintained anymore, but is the only one that works on PHP 5.3/5.5, which we still support. Cannot be tested easily (but code is run by the existing test suite.) Commits ------- af9d644 [Bridge/ProxyManager] Remove direct reference to value holder property
2 parents b1ad577 + af9d644 commit ae65bd8

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