Code Duplication    Length = 10-12 lines in 2 locations

src/Mappable.php 2 locations

@@ 526-537 (lines=12) @@
523
     * @param string $key
524
     * @param mixed  $value
525
     */
526
    protected function setMappedAttribute($key, $value)
527
    {
528
        $segments = explode('.', $this->getMappingForAttribute($key));
529
530
        $attribute = array_pop($segments);
531
532
        if ($target = $this->getTarget($this, $segments)) {
533
            $this->addTargetToSave($target);
534
535
            $target->{$attribute} = $value;
536
        }
537
    }
538
539
    /**
540
     * Flag mapped model to be saved along with this model.
@@ 571-580 (lines=10) @@
568
     * @param  string $key
569
     * @return void
570
     */
571
    protected function forget($key)
572
    {
573
        $mapping = $this->getMappingForAttribute($key);
574
575
        list($target, $attribute) = $this->parseMappedColumn($mapping);
576
577
        $target = $target ? $this->getTarget($this, explode('.', $target)) : $this;
578
579
        unset($target->{$attribute});
580
    }
581
582
    /**
583
     * @codeCoverageIgnore