| @@ 38-47 (lines=10) @@ | ||
| 35 | /** |
|
| 36 | * @return Arrayy|mixed will return a "Arrayy"-object instead of an array |
|
| 37 | */ |
|
| 38 | public function current() |
|
| 39 | { |
|
| 40 | $value = parent::current(); |
|
| 41 | ||
| 42 | if (\is_array($value)) { |
|
| 43 | $value = \call_user_func([$this->class, 'create'], $value, static::class, false); |
|
| 44 | } |
|
| 45 | ||
| 46 | return $value; |
|
| 47 | } |
|
| 48 | ||
| 49 | /** |
|
| 50 | * @param string $offset |
|
| @@ 58-67 (lines=10) @@ | ||
| 55 | * @psalm-param TKey $offset |
|
| 56 | * @param-return Arrayy<TKey,T>|mixed |
|
| 57 | */ |
|
| 58 | public function offsetGet($offset) |
|
| 59 | { |
|
| 60 | $value = parent::offsetGet($offset); |
|
| 61 | ||
| 62 | if (\is_array($value)) { |
|
| 63 | $value = \call_user_func([$this->class, 'create'], $value, static::class, false); |
|
| 64 | } |
|
| 65 | ||
| 66 | return $value; |
|
| 67 | } |
|
| 68 | } |
|
| 69 | ||
| @@ 39-48 (lines=10) @@ | ||
| 36 | * |
|
| 37 | * @psalm-return X |
|
| 38 | */ |
|
| 39 | public function current() |
|
| 40 | { |
|
| 41 | $value = $this->generator->current(); |
|
| 42 | ||
| 43 | if (\is_array($value)) { |
|
| 44 | $value = \call_user_func([$this->class, 'create'], $value, static::class, false); |
|
| 45 | } |
|
| 46 | ||
| 47 | return $value; |
|
| 48 | } |
|
| 49 | } |
|
| 50 | ||