Code Duplication    Length = 10-12 lines in 2 locations

src/Mappable.php 2 locations

@@ 518-529 (lines=12) @@
515
     * @param string $key
516
     * @param mixed  $value
517
     */
518
    protected function setMappedAttribute($key, $value)
519
    {
520
        $segments = explode('.', $this->getMappingForAttribute($key));
521
522
        $attribute = array_pop($segments);
523
524
        if ($target = $this->getTarget($this, $segments)) {
525
            $this->addTargetToSave($target);
526
527
            $target->{$attribute} = $value;
528
        }
529
    }
530
531
    /**
532
     * Flag mapped model to be saved along with this model.
@@ 563-572 (lines=10) @@
560
     * @param  string $key
561
     * @return void
562
     */
563
    protected function forget($key)
564
    {
565
        $mapping = $this->getMappingForAttribute($key);
566
567
        list($target, $attribute) = $this->parseMappedColumn($mapping);
568
569
        $target = $target ? $this->getTarget($this, explode('.', $target)) : $this;
570
571
        unset($target->{$attribute});
572
    }
573
574
    /**
575
     * @codeCoverageIgnore