Test Setup Failed
Push — master ( 5cf724...b9960b )
by Roman
14:09
created

SoftDeletes   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 34
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A bootSoftDeletes() 0 5 1
A getQualifiedDeletedAtColumn() 0 4 1
A trashed() 0 4 1
1
<?php
2
3
namespace fuitad\LaravelCassandra\Eloquent;
4
5
use Exception;
6
7
trait SoftDeletes
8
{
9
    use \Illuminate\Database\Eloquent\SoftDeletes;
10
11
    /**
12
     * Boot the soft deleting trait for a model.
13
     *
14
     * @return void
15
     */
16
    public static function bootSoftDeletes()
17
    {
18
        throw new Exception('Not implemented');
19
        static::addGlobalScope(new SoftDeletingScope);
0 ignored issues
show
Unused Code introduced by
static::addGlobalScope(n...t\SoftDeletingScope()); does not seem to be reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
20
    }
21
22
    /**
23
     * @inheritdoc
24
     */
25
    public function getQualifiedDeletedAtColumn()
26
    {
27
        return $this->getDeletedAtColumn();
28
    }
29
30
    /**
31
     * Determine if the model instance has been soft-deleted.
32
     *
33
     * @return bool
34
     */
35
    public function trashed()
36
    {
37
        return $this->{$this->getDeletedAtColumn()} != '';
38
    }
39
40
}
41