HasPullAt   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 57.14%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 13
ccs 4
cts 7
cp 0.5714
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fillPulled() 0 4 1
A getHasPullAtCastsAttr() 0 4 1
1
<?php
2
3
namespace IproSync\Models;
4
5
use Carbon\Carbon;
6
7
trait HasPullAt
8
{
9 3
    public function getHasPullAtCastsAttr()
10
    {
11 3
        return [
12 3
            'last_pull_at' => 'datetime',
13 3
        ];
14
    }
15
16
    public function fillPulled(?Carbon $datetime = null): static
17
    {
18
        return $this->fill([
0 ignored issues
show
Bug introduced by
It seems like fill() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
        return $this->/** @scrutinizer ignore-call */ fill([
Loading history...
19
            'last_pull_at' => $datetime ?? Carbon::now(),
20
        ]);
21
    }
22
}
23