Code Duplication    Length = 10-10 lines in 3 locations

src/ArrayyIterator.php 2 locations

@@ 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
     * @phpstan-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

src/ArrayyRewindableExtendedGenerator.php 1 location

@@ 38-47 (lines=10) @@
35
     *
36
     * @phpstan-return X
37
     */
38
    public function current()
39
    {
40
        $value = $this->generator->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