| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 50 | public function handle() : int |
||
| 51 | { |
||
| 52 | |||
| 53 | $filePath = $this->argument("file_path"); |
||
| 54 | |||
| 55 | $errors = $this->importService->validate($filePath); |
||
| 56 | |||
| 57 | if (empty($errors) === false) { |
||
| 58 | foreach ($errors as $error) { |
||
| 59 | $this->error($error); |
||
| 60 | } |
||
| 61 | return self::INVALID_INPUT; |
||
| 62 | } |
||
| 63 | |||
| 64 | $this->importService->import($filePath, App\Models\Ward::class); |
||
| 65 | |||
| 66 | $this->info("Wards imported successfully"); |
||
| 67 | |||
| 68 | return self::SUCCESS; |
||
| 69 | |||
| 73 |