Completed
Pull Request — master (#148)
by Freek
04:33
created

ClearCachedEventHandlersCommand   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 6 1
1
<?php
2
3
namespace Spatie\EventProjector\Console;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Filesystem\Filesystem;
7
use Spatie\EventProjector\EventHandlers\EventHandler;
8
use Spatie\EventProjector\Projectionist;
9
use Spatie\Snapshots\MatchesSnapshots;
10
11
final class ClearCachedEventHandlersCommand extends Command
12
{
13
    protected $signature = 'event-projector:clear-event-handlers';
14
15
    protected $description = 'Clear cached event handlers';
16
17
    public function handle(Filesystem $files): void
18
    {
19
        $files->delete(config('event-projector.cache_path'));
20
21
        $this->info('Cached event handlers cleared!');
22
    }
23
}
24
25