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

HasManyIntervals   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 13
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setIntervals() 0 5 1
A addInterval() 0 4 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