Add Contract interface for airport lookup functionality (#365)
* Add Contract interface for airport lookup functionality * style ci fixes
This commit is contained in:
28
app/Services/AirportLookup/VaCentralLookup.php
Normal file
28
app/Services/AirportLookup/VaCentralLookup.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\AirportLookup;
|
||||
|
||||
use App\Contracts\AirportLookup;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use VaCentral\Airport;
|
||||
use VaCentral\HttpException;
|
||||
|
||||
class VaCentralLookup extends AirportLookup
|
||||
{
|
||||
/**
|
||||
* Lookup the information for an airport
|
||||
*
|
||||
* @param string $icao
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAirport($icao)
|
||||
{
|
||||
try {
|
||||
return Airport::get($icao);
|
||||
} catch (HttpException $e) {
|
||||
Log::error($e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user