|
| 1 | +<?php |
| 2 | + |
| 3 | +/* |
| 4 | + * This file is part of the Symfony package. |
| 5 | + * |
| 6 | + * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | + * |
| 8 | + * For the full copyright and license information, please view the LICENSE |
| 9 | + * file that was distributed with this source code. |
| 10 | + */ |
| 11 | + |
| 12 | +namespace Symfony\Component\Cache\Traits\Relay; |
| 13 | + |
| 14 | +if (version_compare(phpversion('relay'), '0.9.0', '>=')) { |
| 15 | + /** |
| 16 | + * @internal |
| 17 | + */ |
| 18 | + trait NullableReturnTrait |
| 19 | + { |
| 20 | + public function dump($key): \Relay\Relay|false|string|null |
| 21 | + { |
| 22 | + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->dump(...\func_get_args()); |
| 23 | + } |
| 24 | + |
| 25 | + public function geodist($key, $src, $dst, $unit = null): \Relay\Relay|false|float|null |
| 26 | + { |
| 27 | + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geodist(...\func_get_args()); |
| 28 | + } |
| 29 | + |
| 30 | + public function hrandfield($hash, $options = null): \Relay\Relay|array|false|string|null |
| 31 | + { |
| 32 | + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hrandfield(...\func_get_args()); |
| 33 | + } |
| 34 | + |
| 35 | + public function xadd($key, $id, $values, $maxlen = 0, $approx = false, $nomkstream = false): \Relay\Relay|false|string|null |
| 36 | + { |
| 37 | + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xadd(...\func_get_args()); |
| 38 | + } |
| 39 | + |
| 40 | + public function zrank($key, $rank, $withscore = false): \Relay\Relay|array|false|int|null |
| 41 | + { |
| 42 | + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrank(...\func_get_args()); |
| 43 | + } |
| 44 | + |
| 45 | + public function zrevrank($key, $rank, $withscore = false): \Relay\Relay|array|false|int|null |
| 46 | + { |
| 47 | + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrevrank(...\func_get_args()); |
| 48 | + } |
| 49 | + |
| 50 | + public function zscore($key, $member): \Relay\Relay|false|float|null |
| 51 | + { |
| 52 | + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zscore(...\func_get_args()); |
| 53 | + } |
| 54 | + } |
| 55 | +} else { |
| 56 | + /** |
| 57 | + * @internal |
| 58 | + */ |
| 59 | + trait NullableReturnTrait |
| 60 | + { |
| 61 | + public function dump($key): \Relay\Relay|false|string |
| 62 | + { |
| 63 | + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->dump(...\func_get_args()); |
| 64 | + } |
| 65 | + |
| 66 | + public function geodist($key, $src, $dst, $unit = null): \Relay\Relay|false|float |
| 67 | + { |
| 68 | + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geodist(...\func_get_args()); |
| 69 | + } |
| 70 | + |
| 71 | + public function hrandfield($hash, $options = null): \Relay\Relay|array|false|string |
| 72 | + { |
| 73 | + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hrandfield(...\func_get_args()); |
| 74 | + } |
| 75 | + |
| 76 | + public function xadd($key, $id, $values, $maxlen = 0, $approx = false, $nomkstream = false): \Relay\Relay|false|string |
| 77 | + { |
| 78 | + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xadd(...\func_get_args()); |
| 79 | + } |
| 80 | + |
| 81 | + public function zrank($key, $rank, $withscore = false): \Relay\Relay|array|false|int |
| 82 | + { |
| 83 | + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrank(...\func_get_args()); |
| 84 | + } |
| 85 | + |
| 86 | + public function zrevrank($key, $rank, $withscore = false): \Relay\Relay|array|false|int |
| 87 | + { |
| 88 | + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrevrank(...\func_get_args()); |
| 89 | + } |
| 90 | + |
| 91 | + public function zscore($key, $member): \Relay\Relay|false|float |
| 92 | + { |
| 93 | + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zscore(...\func_get_args()); |
| 94 | + } |
| 95 | + } |
| 96 | +} |
0 commit comments