Completed
Push — develop ( 6deca1...bf40a6 )
by Adolfo
01:08
created

HasManyPrices   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setPrices() 0 5 1
A addPrice() 0 4 1
1
<?php
2
3
4
namespace Sagitarius29\LaravelSubscriptions\Traits;
5
6
7
use Sagitarius29\LaravelSubscriptions\Contracts\PlanPriceContract;
8
9
trait HasManyPrices
10
{
11
    public function setPrices(array $prices)
12
    {
13
        $this->prices()->delete();
0 ignored issues
show
Bug introduced by
The method prices() does not exist on Sagitarius29\LaravelSubs...ns\Traits\HasManyPrices. Did you maybe mean setPrices()?

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...
14
        $this->prices()->saveMany($prices);
0 ignored issues
show
Bug introduced by
The method prices() does not exist on Sagitarius29\LaravelSubs...ns\Traits\HasManyPrices. Did you maybe mean setPrices()?

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...
15
    }
16
17
    public function addPrice(PlanPriceContract $price)
18
    {
19
        $this->prices()->save($price);
0 ignored issues
show
Bug introduced by
The method prices() does not exist on Sagitarius29\LaravelSubs...ns\Traits\HasManyPrices. Did you maybe mean setPrices()?

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...
20
    }
21
}
22