| Conditions | 2 |
| Paths | 2 |
| Total Lines | 36 |
| Code Lines | 29 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 30 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 2 | public function getAlerts(): array |
|
| 23 | { |
||
| 24 | 2 | $alerts = array(); |
|
| 25 | 2 | $alertData = $this->indexParser->parse($this->xmlProvider->getXml()); |
|
| 26 | |||
| 27 | 2 | foreach ($alertData as $data) { |
|
| 28 | 2 | $alert = new NoaaAlert( |
|
| 29 | 2 | $data['idString'], |
|
| 30 | 2 | $data['idKey'], |
|
| 31 | 2 | $data['updatedDateTime'], |
|
| 32 | 2 | $data['publishedDateTime'], |
|
| 33 | 2 | $data['authorName'], |
|
| 34 | 2 | $data['title'], |
|
| 35 | 2 | $data['link'], |
|
| 36 | 2 | $data['summary'], |
|
| 37 | 2 | $data['capEvent'], |
|
| 38 | 2 | $data['capEffectiveDateTime'], |
|
| 39 | 2 | $data['capExpiresDateTime'], |
|
| 40 | 2 | $data['capStatus'], |
|
| 41 | 2 | $data['capMsgType'], |
|
| 42 | 2 | $data['capCategory'], |
|
| 43 | 2 | $data['capUrgencyExpected'], |
|
| 44 | 2 | $data['capSeverity'], |
|
| 45 | 2 | $data['capCertainty'], |
|
| 46 | 2 | $data['capAreaDesc'], |
|
| 47 | 2 | $data['capPolygon'], |
|
| 48 | 2 | $data['capGeo'], |
|
| 49 | 2 | $data['capGeoString'], |
|
| 50 | 2 | $data['vtec'], |
|
| 51 | 2 | $this->polygonFactory->create($data['capPolygon']) |
|
| 52 | ); |
||
| 53 | |||
| 54 | 2 | $alerts[] = $alert; |
|
| 55 | } |
||
| 56 | |||
| 57 | 2 | return $alerts; |
|
| 58 | } |
||
| 59 | } |