Code Duplication    Length = 12-13 lines in 2 locations

src/Traits/StrictKeyedIterableTrait.php 2 locations

@@ 98-109 (lines=12) @@
95
        return $res;
96
    }
97
98
    public function takeWhile($fn)
99
    {
100
        $res = new static();
101
        foreach ($this as $k => $v) {
102
            if (!$fn($v)) {
103
                break;
104
            }
105
            $res[$k] = $v;
106
        }
107
108
        return $res;
109
    }
110
111
    public function skip($n)
112
    {
@@ 111-123 (lines=13) @@
108
        return $res;
109
    }
110
111
    public function skip($n)
112
    {
113
        $res = new static();
114
        foreach ($this as $k => $v) {
115
            if ($n <= 0) {
116
                $res[$k] = $v;
117
            } else {
118
                --$n;
119
            }
120
        }
121
122
        return $res;
123
    }
124
125
    public function skipWhile($fn)
126
    {