Skip to content

Commit

Permalink
Fix bug on checking null values for main decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
inouire committed Apr 3, 2015
1 parent 4a270ee commit 2325cd9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ChunkDecoder/WindShearChunkDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ public function parse($remaining_metar, $cavok = false)
$runways = null;
} else {
// one or more runways, build array
$runways = array();
$all = false;
$runways = array();
for($k = 2; $k < 9 ; $k+= 3){
if($found[$k] != null){
$runway = $found[$k+2];
$qfu_as_int = Value::toInt($runway);
// check runway qfu validity
// check runway qfu validity
if ($qfu_as_int > 36 || $qfu_as_int < 1) {
throw new ChunkDecoderException($remaining_metar, 'Invalid runway QFU runway visual range information', $this);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/DecodedMetar.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public function setRecentWeather($recent_weather)
return $this;
}

public function isWindshearAllRunways()
public function getWindshearAllRunways()
{
return $this->windshear_all_runways;
}
Expand Down
2 changes: 1 addition & 1 deletion src/MetarDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function parse($raw_metar)
$result = $decoded['result'];
if ($result != null) {
foreach ($result as $key => $value) {
if ($value != null) {
if ($value !== null) {
$setter_name = 'set'.ucfirst($key);
$decoded_metar->$setter_name($value);
}
Expand Down

0 comments on commit 2325cd9

Please sign in to comment.