| Total Complexity | 8 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace GeneaLabs\LaravelModelCaching\Console\Commands; |
||
| 6 | class Clear extends Command |
||
| 7 | { |
||
| 8 | protected $signature = 'modelCache:clear {--model=}'; |
||
| 9 | protected $description = 'Flush cache for a given model. If no model is given, entire model-cache is flushed.'; |
||
| 10 | |||
| 11 | public function handle() |
||
| 12 | { |
||
| 13 | $option = $this->option('model'); |
||
| 14 | |||
| 15 | if (! $option) { |
||
| 16 | return $this->flushEntireCache(); |
||
| 17 | } |
||
| 18 | |||
| 19 | return $this->flushModelCache($option); |
||
| 20 | } |
||
| 21 | |||
| 22 | protected function flushEntireCache() : int |
||
| 31 | } |
||
| 32 | |||
| 33 | protected function flushModelCache(string $option) : int |
||
| 50 | } |
||
| 51 | |||
| 52 | protected function getAllTraitsUsedByClass( |
||
| 70 | } |
||
| 71 | } |
||
| 72 |