@@ -49,6 +49,7 @@ protected function handleResponse(InputInterface $input, OutputInterface $output
49
49
if (array_key_exists ('warnings ' , $ weatherAlertRecords )) {
50
50
$ this ->processAlertData ($ weatherAlertRecords ['warnings ' ], false , $ input , $ output );
51
51
}
52
+
52
53
if (array_key_exists ('vorabInformation ' , $ weatherAlertRecords )) {
53
54
$ this ->processAlertData ($ weatherAlertRecords ['vorabInformation ' ], true , $ input , $ output );
54
55
}
@@ -86,6 +87,7 @@ protected function processAlertData(array $data, bool $isPreliminaryInformation,
86
87
foreach ($ selectedWarnCells as $ warnCellId ) {
87
88
$ this ->processWarnCellAlerts ($ warnCellId , $ data , $ isPreliminaryInformation , $ recordStoragePid , $ progressBar , $ output );
88
89
}
90
+
89
91
$ progressBar ->finish ();
90
92
$ output ->writeln ('' );
91
93
}
@@ -133,6 +135,7 @@ protected function processAlert(
133
135
} else {
134
136
$ this ->insertNewAlert ($ alert , $ warnCellId , $ isPreliminaryInformation , $ recordStoragePid , $ output );
135
137
}
138
+
136
139
$ progressBar ->advance ();
137
140
}
138
141
@@ -173,27 +176,33 @@ protected function getWeatherAlertInstanceForAlert(
173
176
if (isset ($ alert ['level ' ])) {
174
177
$ weatherAlert ['level ' ] = $ alert ['level ' ];
175
178
}
179
+
176
180
if (isset ($ alert ['type ' ])) {
177
181
$ weatherAlert ['type ' ] = $ alert ['type ' ];
178
182
}
183
+
179
184
if (isset ($ alert ['headline ' ])) {
180
185
$ weatherAlert ['title ' ] = $ alert ['headline ' ];
181
186
}
187
+
182
188
if (isset ($ alert ['description ' ])) {
183
189
$ weatherAlert ['description ' ] = $ alert ['description ' ];
184
190
}
191
+
185
192
if (isset ($ alert ['instruction ' ])) {
186
193
$ weatherAlert ['instruction ' ] = $ alert ['instruction ' ];
187
194
}
195
+
188
196
if (isset ($ alert ['start ' ])) {
189
197
$ startTime = new \DateTime ();
190
198
$ startTime ->setTimestamp ((int )substr ((string )$ alert ['start ' ], 0 , -3 ));
191
- $ weatherAlert ['start_date ' ] = ( int ) $ startTime ->getTimestamp ();
199
+ $ weatherAlert ['start_date ' ] = $ startTime ->getTimestamp ();
192
200
}
201
+
193
202
if (isset ($ alert ['end ' ])) {
194
203
$ endTime = new \DateTime ();
195
204
$ endTime ->setTimestamp ((int )substr ((string )$ alert ['end ' ], 0 , -3 ));
196
- $ weatherAlert ['end_date ' ] = ( int ) $ endTime ->getTimestamp ();
205
+ $ weatherAlert ['end_date ' ] = $ endTime ->getTimestamp ();
197
206
}
198
207
199
208
return $ weatherAlert ;
0 commit comments