Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitc66a2f7

Browse files
[Cache][VarExporter] Fix proxy generation to deal with edgy behaviors of internal classes
1 parent39a56d3 commitc66a2f7

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

‎src/Symfony/Component/Cache/Traits/Redis6Proxy.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ public function hVals($key): \Redis|array|false
538538

539539
publicfunctionhscan($key, &$iterator,$pattern =null,$count =0):\Redis|array|bool
540540
{
541-
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hscan($key,$iterator,$pattern,$count,...\array_slice(\func_get_args(),4));
541+
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hscan($key,$iterator, ...\array_slice(\func_get_args(),2));
542542
}
543543

544544
publicfunctionincr($key,$by =1):\Redis|false|int
@@ -888,7 +888,7 @@ public function save(): \Redis|bool
888888

889889
publicfunctionscan(&$iterator,$pattern =null,$count =0,$type =null):array|false
890890
{
891-
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->scan($iterator,$pattern,$count,$type,...\array_slice(\func_get_args(),4));
891+
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->scan($iterator, ...\array_slice(\func_get_args(),1));
892892
}
893893

894894
publicfunctionscard($key):\Redis|false|int
@@ -998,7 +998,7 @@ public function srem($key, $value, ...$other_values): \Redis|false|int
998998

999999
publicfunctionsscan($key, &$iterator,$pattern =null,$count =0):array|false
10001000
{
1001-
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sscan($key,$iterator,$pattern,$count,...\array_slice(\func_get_args(),4));
1001+
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sscan($key,$iterator, ...\array_slice(\func_get_args(),2));
10021002
}
10031003

10041004
publicfunctionssubscribe($channels,$cb):bool
@@ -1278,7 +1278,7 @@ public function zinterstore($dst, $keys, $weights = null, $aggregate = null): \R
12781278

12791279
publicfunctionzscan($key, &$iterator,$pattern =null,$count =0):\Redis|array|false
12801280
{
1281-
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zscan($key,$iterator,$pattern,$count,...\array_slice(\func_get_args(),4));
1281+
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zscan($key,$iterator, ...\array_slice(\func_get_args(),2));
12821282
}
12831283

12841284
publicfunctionzunion($keys,$weights =null,$options =null):\Redis|array|false

‎src/Symfony/Component/Cache/Traits/RedisCluster6Proxy.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ public function hmset($key, $key_values): \RedisCluster|bool
463463

464464
publicfunctionhscan($key, &$iterator,$pattern =null,$count =0):array|bool
465465
{
466-
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hscan($key,$iterator,$pattern,$count,...\array_slice(\func_get_args(),4));
466+
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hscan($key,$iterator, ...\array_slice(\func_get_args(),2));
467467
}
468468

469469
publicfunctionhrandfield($key,$options =null):\RedisCluster|array|string
@@ -738,7 +738,7 @@ public function save($key_or_address): \RedisCluster|bool
738738

739739
publicfunctionscan(&$iterator,$key_or_address,$pattern =null,$count =0):array|bool
740740
{
741-
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->scan($iterator,$key_or_address,$pattern,$count,...\array_slice(\func_get_args(),4));
741+
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->scan($iterator, ...\array_slice(\func_get_args(),1));
742742
}
743743

744744
publicfunctionscard($key):\RedisCluster|false|int
@@ -858,7 +858,7 @@ public function srem($key, $value, ...$other_values): \RedisCluster|false|int
858858

859859
publicfunctionsscan($key, &$iterator,$pattern =null,$count =0):array|false
860860
{
861-
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sscan($key,$iterator,$pattern,$count,...\array_slice(\func_get_args(),4));
861+
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sscan($key,$iterator, ...\array_slice(\func_get_args(),2));
862862
}
863863

864864
publicfunctionstrlen($key):\RedisCluster|false|int
@@ -1103,7 +1103,7 @@ public function zrevrank($key, $member): \RedisCluster|false|int
11031103

11041104
publicfunctionzscan($key, &$iterator,$pattern =null,$count =0):\RedisCluster|array|bool
11051105
{
1106-
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zscan($key,$iterator,$pattern,$count,...\array_slice(\func_get_args(),4));
1106+
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zscan($key,$iterator, ...\array_slice(\func_get_args(),2));
11071107
}
11081108

11091109
publicfunctionzscore($key,$member):\RedisCluster|false|float

‎src/Symfony/Component/Cache/Traits/RelayProxy.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -984,22 +984,22 @@ public function clearBytes(): void
984984

985985
publicfunctionscan(&$iterator,$match =null,$count =0,$type =null):array|false
986986
{
987-
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->scan($iterator,$match,$count,$type,...\array_slice(\func_get_args(),4));
987+
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->scan($iterator, ...\array_slice(\func_get_args(),1));
988988
}
989989

990990
publicfunctionhscan($key, &$iterator,$match =null,$count =0):array|false
991991
{
992-
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hscan($key,$iterator,$match,$count,...\array_slice(\func_get_args(),4));
992+
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hscan($key,$iterator, ...\array_slice(\func_get_args(),2));
993993
}
994994

995995
publicfunctionsscan($key, &$iterator,$match =null,$count =0):array|false
996996
{
997-
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sscan($key,$iterator,$match,$count,...\array_slice(\func_get_args(),4));
997+
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sscan($key,$iterator, ...\array_slice(\func_get_args(),2));
998998
}
999999

10001000
publicfunctionzscan($key, &$iterator,$match =null,$count =0):array|false
10011001
{
1002-
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zscan($key,$iterator,$match,$count,...\array_slice(\func_get_args(),4));
1002+
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zscan($key,$iterator, ...\array_slice(\func_get_args(),2));
10031003
}
10041004

10051005
publicfunctionkeys($pattern):\Relay\Relay|array|false

‎src/Symfony/Component/Cache/composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"psr/log":"^1.1|^2|^3",
2727
"symfony/cache-contracts":"^2.5|^3",
2828
"symfony/service-contracts":"^2.5|^3",
29-
"symfony/var-exporter":"^6.2.10"
29+
"symfony/var-exporter":"^6.3.6"
3030
},
3131
"require-dev": {
3232
"cache/integration-tests":"dev-master",

‎src/Symfony/Component/VarExporter/ProxyHelper.php‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ class_exists(\Symfony\Component\VarExporter\Internal\LazyObjectState::class);
215215

216216
publicstaticfunctionexportSignature(\ReflectionFunctionAbstract$function,bool$withParameterTypes =true,string &$args =null):string
217217
{
218-
$hasByRef =false;
218+
$byRefIndex =0;
219219
$args ='';
220220
$param =null;
221221
$parameters = [];
@@ -225,16 +225,20 @@ public static function exportSignature(\ReflectionFunctionAbstract $function, bo
225225
.($param->isPassedByReference() ?'&' :'')
226226
.($param->isVariadic() ?'...' :'').'$'.$param->name
227227
.($param->isOptional() && !$param->isVariadic() ?' ='.self::exportDefault($param) :'');
228-
$hasByRef =$hasByRef ||$param->isPassedByReference();
228+
if ($param->isPassedByReference()) {
229+
$byRefIndex =1 +$param->getPosition();
230+
}
229231
$args .= ($param->isVariadic() ?'...$' :'$').$param->name.',';
230232
}
231233

232-
if (!$param || !$hasByRef) {
234+
if (!$param || !$byRefIndex) {
233235
$args ='...\func_get_args()';
234236
}elseif ($param->isVariadic()) {
235237
$args =substr($args,0, -2);
236238
}else {
237-
$args .=sprintf('...\array_slice(\func_get_args(), %d)',\count($parameters));
239+
$args =explode(',',$args,1 +$byRefIndex);
240+
$args[$byRefIndex] =sprintf('...\array_slice(\func_get_args(), %d)',$byRefIndex);
241+
$args =implode(',',$args);
238242
}
239243

240244
$signature ='function'.($function->returnsReference() ?'&' :'')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp