Code Duplication    Length = 10-12 lines in 2 locations

lib/Doctrine/ORM/PersistentCollection.php 2 locations

@@ 470-479 (lines=10) @@
467
    /**
468
     * {@inheritdoc}
469
     */
470
    public function set($key, $value)
471
    {
472
        parent::set($key, $value);
473
474
        $this->changed();
475
476
        if (is_object($value) && $this->em) {
477
            $this->em->getUnitOfWork()->cancelOrphanRemoval($value);
478
        }
479
    }
480
481
    /**
482
     * {@inheritdoc}
@@ 484-495 (lines=12) @@
481
    /**
482
     * {@inheritdoc}
483
     */
484
    public function add($value)
485
    {
486
        $this->collection->add($value);
487
488
        $this->changed();
489
490
        if (is_object($value) && $this->em) {
491
            $this->em->getUnitOfWork()->cancelOrphanRemoval($value);
492
        }
493
494
        return true;
495
    }
496
497
    /* ArrayAccess implementation */
498