Code Duplication    Length = 11-13 lines in 4 locations

src/ArrayList.php 2 locations

@@ 71-83 (lines=13) @@
68
    /**
69
     * {@inheritdoc}
70
     */
71
    public function addAll($items)
72
    {
73
        $this->validateTraversable($items);
74
75
        foreach ($items as $item) {
76
            if (is_array($item)) {
77
                $item = new static($item);
78
            }
79
            $this->add($item);
80
        }
81
82
        return $this;
83
    }
84
85
    /**
86
     * {@inheritdoc}
@@ 88-100 (lines=13) @@
85
    /**
86
     * {@inheritdoc}
87
     */
88
    public function setAll($items)
89
    {
90
        $this->validateTraversable($items);
91
92
        foreach ($items as $key => $item) {
93
            if (is_array($item)) {
94
                $item = new static($item);
95
            }
96
            $this->set($key, $item);
97
        }
98
99
        return $this;
100
    }
101
102
103
    /**

src/Dictionary.php 2 locations

@@ 72-82 (lines=11) @@
69
    /**
70
     * {@inheritdoc}
71
     */
72
    public function addAll($items)
73
    {
74
        $this->validateTraversable($items);
75
76
        foreach ($items as $key => $value) {
77
            if (is_array($value)) {
78
                $value = new static($value);
79
            }
80
            $this->add($key, $value);
81
        }
82
    }
83
84
    /**
85
     * {@inheritdoc}
@@ 87-99 (lines=13) @@
84
    /**
85
     * {@inheritdoc}
86
     */
87
    public function setAll($items)
88
    {
89
        $this->validateTraversable($items);
90
91
        foreach ($items as $key => $item) {
92
            if (is_array($item)) {
93
                $item = new static($item);
94
            }
95
            $this->set($key, $item);
96
        }
97
98
        return $this;
99
    }
100
101
    /**
102
     * {@inheritdoc}