Code Duplication    Length = 10-10 lines in 2 locations

src/Zicht/Itertools/lib/Traits/ItemsTrait.php 1 location

@@ 18-27 (lines=10) @@
15
     *
16
     * @return array
17
     */
18
    public function items()
19
    {
20
        $items = [];
21
        if ($this instanceof \Traversable) {
22
            foreach ($this as $key => $value) {
23
                $items [] = new KeyValuePair($key, $value instanceof FiniteIterableInterface ? $value->items() : $value);
24
            }
25
        }
26
        return $items;
27
    }
28
}
29

src/Zicht/Itertools/lib/Traits/ValuesTrait.php 1 location

@@ 17-26 (lines=10) @@
14
     *
15
     * @return array
16
     */
17
    public function values()
18
    {
19
        $values = [];
20
        if ($this instanceof \Traversable) {
21
            foreach ($this as $key => $value) {
22
                $values [] = $value instanceof FiniteIterableInterface ? $value->values() : $value;
23
            }
24
        }
25
        return $values;
26
    }
27
}
28