DeleteCacheCommand   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 8
c 1
b 0
f 0
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 11 1
1
<?php
2
3
namespace Mostafaznv\LaraCache\Commands;
4
5
use Illuminate\Console\Command;
6
use Mostafaznv\LaraCache\Actions\DeleteCacheAction;
7
use Mostafaznv\LaraCache\DTOs\CommandData;
8
use Symfony\Component\Console\Command\Command as SymfonyCommand;
9
10
class DeleteCacheCommand extends Command
11
{
12
    protected $signature = 'laracache:delete {--m|model=*} {--e|entity=*}';
13
    protected $description = 'Deletes one or multiple cache entities in a single model';
14
15
    public function handle(): int
16
    {
17
        $models = $this->option('model');
18
        $entities = $this->option('entity');
19
20
        DeleteCacheAction::make($this)->run(
21
            CommandData::make($models, $entities)
22
        );
23
24
25
        return SymfonyCommand::SUCCESS;
26
    }
27
}
28