@@ -277,15 +277,15 @@ private function phenomenon_code_map( $weather ) {
277277
278278 switch ( $ condition ) {
279279 case 'thunderstorms ' :
280- if ( ! isset ( $ weather ['intensity ' ] ) ) {
281- return 211 ;
282- }
283- if ( 'light ' === $ weather ['intensity ' ] ) {
284- return 210 ;
285- }
286- if ( 'heavy ' === $ weather ['intensity ' ] ) {
287- return 212 ;
280+ if ( array_key_exists ( 'intensity ' , $ weather ) ) {
281+ if ( 'light ' === $ weather ['intensity ' ] ) {
282+ return 210 ;
283+ }
284+ if ( 'heavy ' === $ weather ['intensity ' ] ) {
285+ return 212 ;
286+ }
288287 }
288+ return 211 ;
289289 case 'fog ' :
290290 case 'fog_mist ' :
291291 return 741 ;
@@ -294,15 +294,15 @@ private function phenomenon_code_map( $weather ) {
294294 case 'dust_whirls ' :
295295 return 761 ;
296296 case 'drizzle ' :
297- if ( ! isset ( $ weather ['intensity ' ] ) ) {
298- return 301 ;
299- }
300- if ( 'light ' === $ weather ['intensity ' ] ) {
301- return 300 ;
302- }
303- if ( 'heavy ' === $ weather ['intensity ' ] ) {
304- return 302 ;
297+ if ( array_key_exists ( 'intensity ' , $ weather ) ) {
298+ if ( 'light ' === $ weather ['intensity ' ] ) {
299+ return 300 ;
300+ }
301+ if ( 'heavy ' === $ weather ['intensity ' ] ) {
302+ return 302 ;
303+ }
305304 }
305+ return 301 ;
306306 case 'smoke ' :
307307 return 711 ;
308308 case 'hail ' :
@@ -315,29 +315,29 @@ private function phenomenon_code_map( $weather ) {
315315 case 'ice_pellets ' :
316316 case 'spray ' :
317317 case 'rain ' :
318- if ( ! isset ( $ weather ['intensity ' ] ) ) {
319- return 521 ;
320- }
321- if ( 'light ' === $ weather ['intensity ' ] ) {
322- return 520 ;
323- }
324- if ( 'heavy ' === $ weather ['intensity ' ] ) {
325- return 522 ;
318+ if ( array_key_exists ( 'intensity ' , $ weather ) ) {
319+ if ( 'light ' === $ weather ['intensity ' ] ) {
320+ return 520 ;
321+ }
322+ if ( 'heavy ' === $ weather ['intensity ' ] ) {
323+ return 522 ;
324+ }
326325 }
326+ return 521 ;
327327 case 'sand ' :
328328 case 'sand_storm ' :
329329 return 751 ;
330330 case 'snow_grains ' :
331331 case 'snow ' :
332- if ( ! isset ( $ weather ['intensity ' ] ) ) {
333- return 601 ;
334- }
335- if ( 'light ' === $ weather ['intensity ' ] ) {
336- return 600 ;
337- }
338- if ( 'heavy ' === $ weather ['intensity ' ] ) {
339- return 602 ;
332+ if ( array_key_exists ( 'intensity ' , $ weather ) ) {
333+ if ( 'light ' === $ weather ['intensity ' ] ) {
334+ return 600 ;
335+ }
336+ if ( 'heavy ' === $ weather ['intensity ' ] ) {
337+ return 602 ;
338+ }
340339 }
340+ return 601 ;
341341 case 'squalls ' :
342342 return 771 ;
343343 case 'volcanic_ash ' :
0 commit comments