Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Cache] do not use LazyProxyTrait in RelayProxyTrait #57745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Symfony/Component/Cache/Tests/Traits/RedisProxiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ public function testRelayProxy()
continue;
}

$return = $method->getReturnType() instanceof \ReflectionNamedType && 'void' === (string) $method->getReturnType() ? '' : 'return ';
$return = '__construct' === $method->name || $method->getReturnType() instanceof \ReflectionNamedType && 'void' === (string) $method->getReturnType() ? '' : 'return ';
$expectedMethods[$method->name] = "\n ".ProxyHelper::exportSignature($method, false, $args)."\n".<<<EOPHP
{
{$return}(\$this->lazyObjectState->realInstance ??= (\$this->lazyObjectState->initializer)())->{$method->name}({$args});
{$return}\$this->initializeLazyObject()->{$method->name}({$args});
}

EOPHP;
Expand Down
50 changes: 25 additions & 25 deletions src/Symfony/Component/Cache/Traits/RelayProxyTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,122 +24,122 @@ public function copy($src, $dst, $options = null): \Relay\Relay|bool

public function jsonArrAppend($key, $value_or_array, $path = null): \Relay\Relay|array|false
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonArrAppend(...\func_get_args());
return $this->initializeLazyObject()->jsonArrAppend(...\func_get_args());
}

public function jsonArrIndex($key, $path, $value, $start = 0, $stop = -1): \Relay\Relay|array|false
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonArrIndex(...\func_get_args());
return $this->initializeLazyObject()->jsonArrIndex(...\func_get_args());
}

public function jsonArrInsert($key, $path, $index, $value, ...$other_values): \Relay\Relay|array|false
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonArrInsert(...\func_get_args());
return $this->initializeLazyObject()->jsonArrInsert(...\func_get_args());
}

public function jsonArrLen($key, $path = null): \Relay\Relay|array|false
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonArrLen(...\func_get_args());
return $this->initializeLazyObject()->jsonArrLen(...\func_get_args());
}

public function jsonArrPop($key, $path = null, $index = -1): \Relay\Relay|array|false
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonArrPop(...\func_get_args());
return $this->initializeLazyObject()->jsonArrPop(...\func_get_args());
}

public function jsonArrTrim($key, $path, $start, $stop): \Relay\Relay|array|false
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonArrTrim(...\func_get_args());
return $this->initializeLazyObject()->jsonArrTrim(...\func_get_args());
}

public function jsonClear($key, $path = null): \Relay\Relay|false|int
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonClear(...\func_get_args());
return $this->initializeLazyObject()->jsonClear(...\func_get_args());
}

public function jsonDebug($command, $key, $path = null): \Relay\Relay|false|int
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonDebug(...\func_get_args());
return $this->initializeLazyObject()->jsonDebug(...\func_get_args());
}

public function jsonDel($key, $path = null): \Relay\Relay|false|int
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonDel(...\func_get_args());
return $this->initializeLazyObject()->jsonDel(...\func_get_args());
}

public function jsonForget($key, $path = null): \Relay\Relay|false|int
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonForget(...\func_get_args());
return $this->initializeLazyObject()->jsonForget(...\func_get_args());
}

public function jsonGet($key, $options = [], ...$paths): mixed
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonGet(...\func_get_args());
return $this->initializeLazyObject()->jsonGet(...\func_get_args());
}

public function jsonMerge($key, $path, $value): \Relay\Relay|bool
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonMerge(...\func_get_args());
return $this->initializeLazyObject()->jsonMerge(...\func_get_args());
}

public function jsonMget($key_or_array, $path): \Relay\Relay|array|false
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonMget(...\func_get_args());
return $this->initializeLazyObject()->jsonMget(...\func_get_args());
}

public function jsonMset($key, $path, $value, ...$other_triples): \Relay\Relay|bool
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonMset(...\func_get_args());
return $this->initializeLazyObject()->jsonMset(...\func_get_args());
}

public function jsonNumIncrBy($key, $path, $value): \Relay\Relay|array|false
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonNumIncrBy(...\func_get_args());
return $this->initializeLazyObject()->jsonNumIncrBy(...\func_get_args());
}

public function jsonNumMultBy($key, $path, $value): \Relay\Relay|array|false
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonNumMultBy(...\func_get_args());
return $this->initializeLazyObject()->jsonNumMultBy(...\func_get_args());
}

public function jsonObjKeys($key, $path = null): \Relay\Relay|array|false
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonObjKeys(...\func_get_args());
return $this->initializeLazyObject()->jsonObjKeys(...\func_get_args());
}

public function jsonObjLen($key, $path = null): \Relay\Relay|array|false
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonObjLen(...\func_get_args());
return $this->initializeLazyObject()->jsonObjLen(...\func_get_args());
}

public function jsonResp($key, $path = null): \Relay\Relay|array|false|int|string
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonResp(...\func_get_args());
return $this->initializeLazyObject()->jsonResp(...\func_get_args());
}

public function jsonSet($key, $path, $value, $condition = null): \Relay\Relay|bool
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonSet(...\func_get_args());
return $this->initializeLazyObject()->jsonSet(...\func_get_args());
}

public function jsonStrAppend($key, $value, $path = null): \Relay\Relay|array|false
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonStrAppend(...\func_get_args());
return $this->initializeLazyObject()->jsonStrAppend(...\func_get_args());
}

public function jsonStrLen($key, $path = null): \Relay\Relay|array|false
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonStrLen(...\func_get_args());
return $this->initializeLazyObject()->jsonStrLen(...\func_get_args());
}

public function jsonToggle($key, $path): \Relay\Relay|array|false
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonToggle(...\func_get_args());
return $this->initializeLazyObject()->jsonToggle(...\func_get_args());
}

public function jsonType($key, $path = null): \Relay\Relay|array|false
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonType(...\func_get_args());
return $this->initializeLazyObject()->jsonType(...\func_get_args());
}
}
} else {
Expand All @@ -150,7 +150,7 @@ trait RelayProxyTrait
{
public function copy($src, $dst, $options = null): \Relay\Relay|false|int
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->copy(...\func_get_args());
return $this->initializeLazyObject()->copy(...\func_get_args());
}
}
}