Code Duplication    Length = 13-13 lines in 2 locations

lib/Doctrine/ODM/MongoDB/PersistentCollection/PersistentCollectionTrait.php 2 locations

@@ 257-269 (lines=13) @@
254
    }
255
256
    /** {@inheritdoc} */
257
    public function getDeletedDocuments()
258
    {
259
        $compare = function ($a, $b) {
260
            $compareA = is_object($a) ? spl_object_hash($a) : $a;
261
            $compareb = is_object($b) ? spl_object_hash($b) : $b;
262
            return $compareA === $compareb ? 0 : ($compareA > $compareb ? 1 : -1);
263
        };
264
        return array_values(array_udiff(
265
            $this->snapshot,
266
            $this->coll->toArray(),
267
            $compare
268
        ));
269
    }
270
271
    /** {@inheritdoc} */
272
    public function getInsertDiff()
@@ 282-294 (lines=13) @@
279
    }
280
281
    /** {@inheritdoc} */
282
    public function getInsertedDocuments()
283
    {
284
        $compare = function ($a, $b) {
285
            $compareA = is_object($a) ? spl_object_hash($a) : $a;
286
            $compareb = is_object($b) ? spl_object_hash($b) : $b;
287
            return $compareA === $compareb ? 0 : ($compareA > $compareb ? 1 : -1);
288
        };
289
        return array_values(array_udiff(
290
            $this->coll->toArray(),
291
            $this->snapshot,
292
            $compare
293
        ));
294
    }
295
296
    /** {@inheritdoc} */
297
    public function getOwner()