Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 86ee658

Browse filesBrowse files
bug #49255 [Cache] Fix Redis proxies (nicolas-grekas)
This PR was merged into the 6.2 branch. Discussion ---------- [Cache] Fix Redis proxies | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #49191 | License | MIT | Doc PR | - I thought `func_get_args()` would forward references, but it looks like it doesn't, at least for internal classes. Commits ------- f3fafc7 [Cache] Fix Redis proxies
2 parents 0737399 + f3fafc7 commit 86ee658
Copy full SHA for 86ee658

File tree

5 files changed

+928
-903
lines changed
Filter options

5 files changed

+928
-903
lines changed

‎src/Symfony/Component/Cache/Tests/Traits/RedisProxiesTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Traits/RedisProxiesTest.php
+12-2Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,15 @@ public function testRedis5Proxy($class)
3434
if ('reset' === $method->name || method_exists(LazyProxyTrait::class, $method->name)) {
3535
continue;
3636
}
37+
$args = [];
38+
foreach ($method->getParameters() as $param) {
39+
$args[] = ($param->isVariadic() ? '...' : '').'$'.$param->name;
40+
}
41+
$args = implode(', ', $args);
3742
$return = $method->getReturnType() instanceof \ReflectionNamedType && 'void' === (string) $method->getReturnType() ? '' : 'return ';
3843
$methods[] = "\n ".ProxyHelper::exportSignature($method, false)."\n".<<<EOPHP
3944
{
40-
{$return}\$this->lazyObjectReal->{$method->name}(...\\func_get_args());
45+
{$return}\$this->lazyObjectReal->{$method->name}({$args});
4146
}
4247
4348
EOPHP;
@@ -71,10 +76,15 @@ public function testRedis6Proxy($class, $stub)
7176
if ('reset' === $method->name || method_exists(LazyProxyTrait::class, $method->name)) {
7277
continue;
7378
}
79+
$args = [];
80+
foreach ($method->getParameters() as $param) {
81+
$args[] = ($param->isVariadic() ? '...' : '').'$'.$param->name;
82+
}
83+
$args = implode(', ', $args);
7484
$return = $method->getReturnType() instanceof \ReflectionNamedType && 'void' === (string) $method->getReturnType() ? '' : 'return ';
7585
$methods[] = "\n ".ProxyHelper::exportSignature($method, false)."\n".<<<EOPHP
7686
{
77-
{$return}\$this->lazyObjectReal->{$method->name}(...\\func_get_args());
87+
{$return}\$this->lazyObjectReal->{$method->name}({$args});
7888
}
7989
8090
EOPHP;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.