Code Duplication    Length = 10-12 lines in 2 locations

src/Mappable.php 2 locations

@@ 513-524 (lines=12) @@
510
     * @param string $key
511
     * @param mixed  $value
512
     */
513
    protected function setMappedAttribute($key, $value)
514
    {
515
        $segments = explode('.', $this->getMappingForAttribute($key));
516
517
        $attribute = array_pop($segments);
518
519
        if ($target = $this->getTarget($this, $segments)) {
520
            $this->addTargetToSave($target);
521
522
            $target->{$attribute} = $value;
523
        }
524
    }
525
526
    /**
527
     * Flag mapped model to be saved along with this model.
@@ 558-567 (lines=10) @@
555
     * @param  string $key
556
     * @return void
557
     */
558
    protected function forget($key)
559
    {
560
        $mapping = $this->getMappingForAttribute($key);
561
562
        list($target, $attribute) = $this->parseMappedColumn($mapping);
563
564
        $target = $target ? $this->getTarget($this, explode('.', $target)) : $this;
565
566
        unset($target->{$attribute});
567
    }
568
569
    /**
570
     * @codeCoverageIgnore