Code Duplication    Length = 10-12 lines in 2 locations

src/Mappable.php 2 locations

@@ 508-519 (lines=12) @@
505
     * @param string $key
506
     * @param mixed  $value
507
     */
508
    protected function setMappedAttribute($key, $value)
509
    {
510
        $segments = explode('.', $this->getMappingForAttribute($key));
511
512
        $attribute = array_pop($segments);
513
514
        if ($target = $this->getTarget($this, $segments)) {
515
            $this->addTargetToSave($target);
516
517
            $target->{$attribute} = $value;
518
        }
519
    }
520
521
    /**
522
     * Flag mapped model to be saved along with this model.
@@ 553-562 (lines=10) @@
550
     * @param  string $key
551
     * @return void
552
     */
553
    protected function forget($key)
554
    {
555
        $mapping = $this->getMappingForAttribute($key);
556
557
        list($target, $attribute) = $this->parseMappedColumn($mapping);
558
559
        $target = $target ? $this->getTarget($this, explode('.', $target)) : $this;
560
561
        unset($target->{$attribute});
562
    }
563
564
    /**
565
     * @codeCoverageIgnore