SoftDeletes   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A getQualifiedDeletedAtColumn() 0 9 3
1
<?php
2
3
namespace ProAI\Versioning;
4
5
use Illuminate\Database\Eloquent\SoftDeletes as SoftDeletesTrait;
6
7
trait SoftDeletes
8
{
9
    use SoftDeletesTrait;
10
11
    /**
12
     * Get the fully qualified "deleted at" column.
13
     *
14
     * @return string
15
     */
16
    public function getQualifiedDeletedAtColumn()
17
    {
18
        $deletedAt = $this->getDeletedAtColumn();
19
20
        if (isset($this->versioned) && in_array($deletedAt, $this->versioned)) {
21
            return $this->getVersionTable().'.'.$deletedAt;
0 ignored issues
show
Bug introduced by
It seems like getVersionTable() 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

21
            return $this->/** @scrutinizer ignore-call */ getVersionTable().'.'.$deletedAt;
Loading history...
22
        }
23
24
        return $this->getTable().'.'.$deletedAt;
0 ignored issues
show
Bug introduced by
It seems like getTable() 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

24
        return $this->/** @scrutinizer ignore-call */ getTable().'.'.$deletedAt;
Loading history...
25
    }
26
}
27