Completed
Push — master ( 8ce3f9...e1543f )
by Adolfo
14s queued 11s
created

HasManyIntervals::addInterval()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Sagitarius29\LaravelSubscriptions\Traits;
4
5
use Sagitarius29\LaravelSubscriptions\Contracts\PlanIntervalContract;
6
7
trait HasManyIntervals
8
{
9
    public function setIntervals(array $intervals)
10
    {
11
        $this->intervals()->delete();
0 ignored issues
show
Bug introduced by
The method intervals() does not exist on Sagitarius29\LaravelSubs...Traits\HasManyIntervals. Did you maybe mean setIntervals()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
12
        $this->intervals()->saveMany($intervals);
0 ignored issues
show
Bug introduced by
The method intervals() does not exist on Sagitarius29\LaravelSubs...Traits\HasManyIntervals. Did you maybe mean setIntervals()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
13
    }
14
15
    public function addInterval(PlanIntervalContract $interval)
16
    {
17
        $this->intervals()->save($interval);
0 ignored issues
show
Bug introduced by
The method intervals() does not exist on Sagitarius29\LaravelSubs...Traits\HasManyIntervals. Did you maybe mean setIntervals()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
18
    }
19
}
20