Code Duplication    Length = 12-13 lines in 2 locations

src/Traits/StrictKeyedIterableTrait.php 2 locations

@@ 83-94 (lines=12) @@
80
        return $res;
81
    }
82
83
    public function takeWhile($fn)
84
    {
85
        $res = new static();
86
        foreach ($this as $k => $v) {
87
            if (!$fn($v)) {
88
                break;
89
            }
90
            $res[$k] = $v;
91
        }
92
93
        return $res;
94
    }
95
96
    public function skip($n)
97
    {
@@ 96-108 (lines=13) @@
93
        return $res;
94
    }
95
96
    public function skip($n)
97
    {
98
        $res = new static();
99
        foreach ($this as $k => $v) {
100
            if ($n <= 0) {
101
                $res[$k] = $v;
102
            } else {
103
                --$n;
104
            }
105
        }
106
107
        return $res;
108
    }
109
110
    public function skipWhile($fn)
111
    {