| Total Complexity | 6 |
| Total Lines | 62 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class PurgeFilesCommand extends Command |
||
| 10 | { |
||
| 11 | |||
| 12 | /** |
||
| 13 | * The name and signature of the console command. |
||
| 14 | * |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | protected $signature = 'dusk-reporter:purge {--path=} {--y|yes}'; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * The console command description. |
||
| 21 | * |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | protected $description = 'Purge dusk report directory'; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Execute the console command. |
||
| 28 | * |
||
| 29 | * @return mixed |
||
| 30 | */ |
||
| 31 | public function handle() |
||
| 32 | { |
||
| 33 | if ($this->option('path')) { |
||
| 34 | $this->purgeDebuggingFiles($this->option('path')); |
||
| 35 | |||
| 36 | return 0; |
||
| 37 | } |
||
| 38 | |||
| 39 | $this->purgeDebuggingFiles( |
||
| 40 | LaravelDuskReporter::storeBuildAt() |
||
| 41 | ); |
||
| 42 | |||
| 43 | return 0; |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Purge report folder. |
||
| 48 | * |
||
| 49 | * @param string $path |
||
| 50 | * @param string $patterns |
||
| 51 | * |
||
| 52 | * @return void |
||
| 53 | */ |
||
| 54 | protected function purgeDebuggingFiles($path) |
||
| 71 | } |
||
| 72 | } |
||
| 73 |