Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 3 |
| DedupError | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
| handle | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
| 1 | <?php |
| 2 | |
| 3 | namespace Qmp\Laravel\Deduplication\Console\Commands; |
| 4 | |
| 5 | use Illuminate\Console\Command; |
| 6 | use Qmp\Laravel\Deduplication\Models\Session; |
| 7 | |
| 8 | class DedupError extends Command |
| 9 | { |
| 10 | /** |
| 11 | * The name and signature of the console command. |
| 12 | * |
| 13 | * @var string |
| 14 | */ |
| 15 | protected $signature = 'dedup:error |
| 16 | {sessionId : The session id} |
| 17 | {--message= : The error message}'; |
| 18 | |
| 19 | /** |
| 20 | * The console command description. |
| 21 | * |
| 22 | * @var string |
| 23 | */ |
| 24 | protected $description = 'Set error in the report'; |
| 25 | /** |
| 26 | * Execute the console command. |
| 27 | * |
| 28 | * @return mixed |
| 29 | */ |
| 30 | public function handle(): void |
| 31 | { |
| 32 | $session = Session::findOrFail($this->argument('sessionId')); |
| 33 | $session->update(['error' => $this->option('message')]); |
| 34 | } |
| 35 | } |