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

ClearCachedEventHandlersCommand::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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