Skip to content

Commit

Permalink
Fixes issue #3 caused by deprecated NOAA service endpoint. Syntax fix…
Browse files Browse the repository at this point in the history
…es (PSR formatting) and some namespace use cases cleaned up.
  • Loading branch information
allebb committed Nov 17, 2016
1 parent 2e0c341 commit 7b2a2f6
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/Examples.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
* this can be achieved by
*/
$leib = new Metar('LEIB');
$leib->setProvider('VATSIM');
$leib->setProvider(Ballen\Metar\Providers\Vatsim::class);
echo sprintf('The VATSIM METAR report for Ibiza airport (LEIB) is: %s', $leib);

1 change: 0 additions & 1 deletion lib/Helpers/MetarHTTPClient.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

namespace Ballen\Metar\Helpers;

use GuzzleHttp\Client as HttpClient;
Expand Down
1 change: 0 additions & 1 deletion lib/Metar.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

namespace Ballen\Metar;

/**
Expand Down
2 changes: 0 additions & 2 deletions lib/Providers/Ivao.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

namespace Ballen\Metar\Providers;

/**
Expand All @@ -14,7 +13,6 @@
* @link http://www.bobbyallen.me
*
*/
use \Ballen\Metar\Providers\MetarProviderInterface;
use \Ballen\Metar\Helpers\MetarHTTPClient;

/**
Expand Down
1 change: 0 additions & 1 deletion lib/Providers/MetarProviderInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

namespace Ballen\Metar\Providers;

/**
Expand Down
4 changes: 1 addition & 3 deletions lib/Providers/Noaa.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

namespace Ballen\Metar\Providers;

/**
Expand All @@ -14,7 +13,6 @@
* @link http://www.bobbyallen.me
*
*/
use \Ballen\Metar\Providers\MetarProviderInterface;
use \Ballen\Metar\Helpers\MetarHTTPClient;

/**
Expand All @@ -24,7 +22,7 @@
class Noaa extends MetarHTTPClient implements MetarProviderInterface
{

private $serviceUrl = 'http://weather.noaa.gov/pub/data/observations/metar/stations/{{_ICAO_}}.TXT';
private $serviceUrl = 'http://tgftp.nws.noaa.gov/data/observations/metar/stations/{{_ICAO_}}.TXT';
private $icao;

public function __construct($icao)
Expand Down
2 changes: 0 additions & 2 deletions lib/Providers/Vatsim.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

namespace Ballen\Metar\Providers;

/**
Expand All @@ -14,7 +13,6 @@
* @link http://www.bobbyallen.me
*
*/
use \Ballen\Metar\Providers\MetarProviderInterface;
use \Ballen\Metar\Helpers\MetarHTTPClient;

/**
Expand Down

0 comments on commit 7b2a2f6

Please sign in to comment.