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

HasManyPrices::addPrice()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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