Skip to content

Commit

Permalink
minor #33180 [ProxyManager] fix closure binding (nicolas-grekas)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.4 branch.

Discussion
----------

[ProxyManager] fix closure binding

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #33037
| License       | MIT
| Doc PR        | -

Follows #32992

Commits
-------

31f9208 [ProxyManager] fix closure binding
  • Loading branch information
nicolas-grekas committed Aug 15, 2019
2 parents 08147dd + 31f9208 commit 1e47f0f
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -113,7 +113,7 @@ public function getProxyCode(Definition $definition)
}

if (version_compare(self::getProxyManagerVersion(), '2.5', '<')) {
$code = str_replace(' \Closure::bind(function ', ' \Closure::bind(static function ', $code);
$code = preg_replace('/ \\\\Closure::bind\(function ((?:& )?\(\$instance(?:, \$value)?\))/', ' \Closure::bind(static function \1', $code);
}

return $code;
Expand Down

0 comments on commit 1e47f0f

Please sign in to comment.