Code Duplication    Length = 10-12 lines in 2 locations

lib/Doctrine/ORM/PersistentCollection.php 2 locations

@@ 462-471 (lines=10) @@
459
    /**
460
     * {@inheritdoc}
461
     */
462
    public function set($key, $value)
463
    {
464
        parent::set($key, $value);
465
466
        $this->changed();
467
468
        if (is_object($value) && $this->em) {
469
            $this->em->getUnitOfWork()->cancelOrphanRemoval($value);
470
        }
471
    }
472
473
    /**
474
     * {@inheritdoc}
@@ 476-487 (lines=12) @@
473
    /**
474
     * {@inheritdoc}
475
     */
476
    public function add($value)
477
    {
478
        $this->collection->add($value);
479
480
        $this->changed();
481
482
        if (is_object($value) && $this->em) {
483
            $this->em->getUnitOfWork()->cancelOrphanRemoval($value);
484
        }
485
486
        return true;
487
    }
488
489
    /* ArrayAccess implementation */
490