Code Duplication    Length = 10-10 lines in 2 locations

ArrayCollection.php 2 locations

@@ 179-188 (lines=10) @@
176
    /**
177
     * {@inheritdoc}
178
     */
179
    public function sort(ComparatorInterface $criteria = null)
180
    {
181
        if ($criteria === null) {
182
            $criteria = new Comparator();
183
        }
184
185
        uasort($this->items, function ($a, $b) use ($criteria) {
186
            return $criteria->compare($a, $b);
187
        });
188
    }
189
190
    /**
191
     * {@inheritdoc}
@@ 193-202 (lines=10) @@
190
    /**
191
     * {@inheritdoc}
192
     */
193
    public function sortByKey(ComparatorInterface $criteria = null)
194
    {
195
        if ($criteria === null) {
196
            $criteria = new Comparator();
197
        }
198
199
        uksort($this->items, function ($a, $b) use ($criteria) {
200
            return $criteria->compare($a, $b);
201
        });
202
    }
203
204
    /**
205
     * {@inheritdoc}