Passed
Push — develop ( 6302a9...3db2fb )
by Septianata
04:45
created

Event   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 4
dl 0
loc 13
ccs 3
cts 3
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A bootEvent() 0 4 1
1
<?php
2
3
namespace App\Models\Concerns\Denomination;
4
5
use App\Models\Denomination;
6
use App\Support\Model\Event as ModelEvent;
7
use Illuminate\Support\Facades\Storage;
8
9
/**
10
 * @see \App\Models\Denomination
11
 */
12
trait Event
13
{
14
    use ModelEvent;
15
16
    /**
17
     * Boot the trait on the model.
18
     *
19
     * @return void
20
     */
21 9
    protected static function bootEvent()
22
    {
23 9
        static::deleting(function (Denomination $model) {
24 2
            Storage::delete(Denomination::IMAGE_PATH . '/' . $model->getRawOriginal('image'));
0 ignored issues
show
Bug introduced by
Are you sure $model->getRawOriginal('image') of type array|mixed can be used in concatenation? ( Ignorable by Annotation )

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

24
            Storage::delete(Denomination::IMAGE_PATH . '/' . /** @scrutinizer ignore-type */ $model->getRawOriginal('image'));
Loading history...
25 9
        });
26 9
    }
27
}
28