Total Complexity | 2 |
Total Lines | 54 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class LoadDataToDBCommand extends Command |
||
9 | { |
||
10 | use HasTablesClassesMap, HasSuffixOption; |
||
11 | |||
12 | /** |
||
13 | * The name and signature of the console command. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $signature = 'geonames:import:file-to-db |
||
18 | {type : Migration type. } |
||
19 | {file? : Csv file path. } |
||
20 | {--suffix= : Suffix used for specify country if need. } |
||
21 | {--truncate : Truncate table before import. } |
||
22 | '; |
||
23 | |||
24 | /** |
||
25 | * The console command description. |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $description = 'Upload data from csv file to DB.'; |
||
30 | |||
31 | /** |
||
32 | * The filesystem instance. |
||
33 | * |
||
34 | * @var Filesystem |
||
35 | */ |
||
36 | protected Filesystem $files; |
||
37 | |||
38 | /** |
||
39 | * Create a new command instance. |
||
40 | * |
||
41 | * @param Filesystem $files |
||
42 | * |
||
43 | * @return void |
||
44 | */ |
||
45 | 18 | public function __construct(Filesystem $files) |
|
46 | { |
||
47 | 18 | parent::__construct(); |
|
48 | |||
49 | 18 | $this->files = $files; |
|
50 | 18 | } |
|
51 | |||
52 | 11 | public function handle() |
|
62 | } |
||
63 | } |
||
64 |