Completed
Push — master ( e68c06...8ce3f9 )
by Adolfo
14s queued 11s
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
namespace Sagitarius29\LaravelSubscriptions\Traits;
4
5
use Sagitarius29\LaravelSubscriptions\Contracts\PlanPriceContract;
6
7
trait HasManyPrices
8
{
9
    public function setPrices(array $prices)
10
    {
11
        $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...
12
        $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...
13
    }
14
15
    public function addPrice(PlanPriceContract $price)
16
    {
17
        $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...
18
    }
19
}
20