@@ -18,23 +18,23 @@ |
||
| 18 | 18 | |
| 19 | 19 | $this['LocalFile'] = getenv("NoaaLocalFilePath"); |
| 20 | 20 | |
| 21 | - $this['NoaaAlertManager'] = function ($c) { |
|
| 21 | + $this['NoaaAlertManager'] = function($c) { |
|
| 22 | 22 | return new NoaaAlertManager($c['XmlProvider'], $c['IndexParser']); |
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | - $this['XmlProvider'] = function ($c) { |
|
| 25 | + $this['XmlProvider'] = function($c) { |
|
| 26 | 26 | return $c['XmlProviderFactory']->getXmlProvider(); |
| 27 | 27 | }; |
| 28 | 28 | |
| 29 | - $this['XmlProviderFactory'] = function ($c) { |
|
| 29 | + $this['XmlProviderFactory'] = function($c) { |
|
| 30 | 30 | return new XmlProviderFactory($c['LocalFile']); |
| 31 | 31 | }; |
| 32 | 32 | |
| 33 | - $this['IndexParser'] = function ($c) { |
|
| 33 | + $this['IndexParser'] = function($c) { |
|
| 34 | 34 | return new IndexParser($c['XmlParser']); |
| 35 | 35 | }; |
| 36 | 36 | |
| 37 | - $this['XmlParser'] = function ($c) { |
|
| 37 | + $this['XmlParser'] = function($c) { |
|
| 38 | 38 | return new XmlParser(); |
| 39 | 39 | }; |
| 40 | 40 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | { |
| 19 | 19 | $this->xmlParser = $xmlParser; |
| 20 | 20 | |
| 21 | - if($xmlParser === null) { |
|
| 21 | + if ($xmlParser === null) { |
|
| 22 | 22 | $this->xmlParser = new XmlParser(); |
| 23 | 23 | } |
| 24 | 24 | } |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | // Process each alert ("ENTRY") |
| 37 | 37 | $resultArray = array(); |
| 38 | 38 | |
| 39 | - foreach($alertDataArray as $alert) { |
|
| 39 | + foreach ($alertDataArray as $alert) { |
|
| 40 | 40 | $parsedAlert = $this->parseAlert($alert); |
| 41 | - if($parsedAlert !== null) { |
|
| 41 | + if ($parsedAlert !== null) { |
|
| 42 | 42 | $resultArray[] = $parsedAlert; |
| 43 | 43 | } |
| 44 | 44 | } |
@@ -80,28 +80,28 @@ discard block |
||
| 80 | 80 | $expiresDateTime = null; |
| 81 | 81 | $effectiveDateTime = null; |
| 82 | 82 | |
| 83 | - if(!isset($alert['name']) || $alert['name'] != 'ENTRY') { |
|
| 83 | + if (!isset($alert['name']) || $alert['name'] != 'ENTRY') { |
|
| 84 | 84 | return null; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | // Loop through attributes and set values |
| 88 | - foreach($alert['children'] as $element){ |
|
| 88 | + foreach ($alert['children'] as $element) { |
|
| 89 | 89 | $elementName = $element['name']; |
| 90 | 90 | $elementAttrs = $element['attrs']; |
| 91 | - if(isset($element['tagData'])){ |
|
| 91 | + if (isset($element['tagData'])) { |
|
| 92 | 92 | $elementData = $element['tagData']; |
| 93 | 93 | } else { |
| 94 | 94 | $elementData = ''; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | |
| 98 | - switch($elementName){ |
|
| 98 | + switch ($elementName) { |
|
| 99 | 99 | case 'ID': |
| 100 | 100 | $idString = $elementData; |
| 101 | 101 | break; |
| 102 | 102 | case 'UPDATED': |
| 103 | 103 | $updatedDateTime = new \DateTime($elementData); |
| 104 | - $updatedTime = $updatedDateTime->format('Y-m-d H:i:s'); |
|
| 104 | + $updatedTime = $updatedDateTime->format('Y-m-d H:i:s'); |
|
| 105 | 105 | break; |
| 106 | 106 | case 'PUBLISHED': |
| 107 | 107 | $publishedDateTime = new \DateTime($elementData); |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | $geoArray = array(); |
| 160 | 160 | |
| 161 | 161 | // parse into simple array |
| 162 | - foreach($element['children'] as $geo) { |
|
| 163 | - if(isset($geo['tagData'])) { |
|
| 162 | + foreach ($element['children'] as $geo) { |
|
| 163 | + if (isset($geo['tagData'])) { |
|
| 164 | 164 | $geoArray[] = $geo['tagData']; |
| 165 | 165 | } |
| 166 | 166 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | break; |
| 172 | 172 | case 'CAP:PARAMETERS': |
| 173 | 173 | $paramArray = array(); |
| 174 | - foreach($element['children'] as $param){ |
|
| 174 | + foreach ($element['children'] as $param) { |
|
| 175 | 175 | $paramArray[] = $param['tagData']; |
| 176 | 176 | } |
| 177 | 177 | $capParameters = implode(', ', $paramArray); |
@@ -246,8 +246,8 @@ discard block |
||
| 246 | 246 | $currentLocationKey = 'null'; |
| 247 | 247 | $geoLocArray = array(); |
| 248 | 248 | |
| 249 | - foreach($geoArray as $geoLoc) { |
|
| 250 | - if(in_array($geoLoc, $locationFormatTypes)) { |
|
| 249 | + foreach ($geoArray as $geoLoc) { |
|
| 250 | + if (in_array($geoLoc, $locationFormatTypes)) { |
|
| 251 | 251 | $currentLocationKey = $geoLoc; |
| 252 | 252 | $geoLocArray[$geoLoc] = array(); |
| 253 | 253 | } else { |