| Total Complexity | 4 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class ClearStaticCache extends Command |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * The name and signature of the console command. |
||
| 12 | * |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | protected $signature = 'static-html-cache:clear'; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * The console command description. |
||
| 19 | * |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | protected $description = 'Clear static html-response caches'; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var Filesystem |
||
| 26 | */ |
||
| 27 | private $files; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Create a new command instance. |
||
| 31 | * |
||
| 32 | * @param Filesystem $files |
||
| 33 | */ |
||
| 34 | 7 | public function __construct(Filesystem $files) |
|
| 35 | { |
||
| 36 | 7 | $this->files = $files; |
|
| 37 | |||
| 38 | 7 | parent::__construct(); |
|
| 39 | 7 | } |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Execute the console command. |
||
| 43 | */ |
||
| 44 | 7 | public function handle() |
|
| 45 | { |
||
| 46 | 7 | $this->clearStorageDirectory(config('static-html-cache.cache_path_prefix')); |
|
| 47 | |||
| 48 | 7 | $this->info('Static caches cleared!'); |
|
| 49 | 7 | } |
|
| 50 | |||
| 51 | /** |
||
| 52 | * @param string $path |
||
| 53 | */ |
||
| 54 | 7 | private function clearStorageDirectory(string $path) |
|
| 61 | } |
||
| 62 | 7 | } |
|
| 63 | } |
||
| 64 |