FileDeleteOne::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 2
nc 2
nop 1
1
<?php
2
3
namespace Ikechukwukalu\Clamavfileupload\Listeners;
4
5
use Ikechukwukalu\Clamavfileupload\Facades\Services\FileUpload;
6
use Ikechukwukalu\Clamavfileupload\Events\QueuedDeleteOne;
7
use Ikechukwukalu\Clamavfileupload\Events\QueuedForceDeleteOne;
8
use Illuminate\Contracts\Queue\ShouldQueue;
9
use Illuminate\Queue\InteractsWithQueue;
10
11
class FileDeleteOne implements ShouldQueue
12
{
13
14
    public function handle(QueuedDeleteOne|QueuedForceDeleteOne $event): void
15
    {
16
        if ($event instanceof QueuedForceDeleteOne) {
17
            FileUpload::forceDeleteOne($event->ids, $event->ref);
0 ignored issues
show
Bug introduced by
The method forceDeleteOne() does not exist on Ikechukwukalu\Clamavfile...des\Services\FileUpload. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

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

17
            FileUpload::/** @scrutinizer ignore-call */ 
18
                        forceDeleteOne($event->ids, $event->ref);
Loading history...
18
            return;
19
        }
20
21
        FileUpload::deleteOne($event->ids, $event->ref);
0 ignored issues
show
Bug introduced by
The method deleteOne() does not exist on Ikechukwukalu\Clamavfile...des\Services\FileUpload. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

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

21
        FileUpload::/** @scrutinizer ignore-call */ 
22
                    deleteOne($event->ids, $event->ref);
Loading history...
22
    }
23
24
}
25