Passed
Pull Request — master (#12)
by Mostafa
11:54
created

DeleteCacheCommand::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 11
rs 10
cc 1
nc 1
nop 0
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