phpvms/app/Contracts/AirportLookup.php
Nabeel S 6018a6dcaa
Add Contract interface for airport lookup functionality (#365)
* Add Contract interface for airport lookup functionality

* style ci fixes
2019-08-22 14:32:49 -04:00

28 lines
809 B
PHP

<?php
namespace App\Contracts;
use App\Models\Airport;
abstract class AirportLookup
{
/**
* Lookup the information for an airport. Needs to return an instance of the
* Airport model, or an array with the properties listed in the Airport model.
*
* The in-use implementation can be changed in the config/phpvms.php file, so
* different services can be used, in-case vaCentral one isn't working or there
* is a better one available. Don't handle any caching in this layer, that happens
* at the service layer
*
* Return null if there's an error or nothing was found
*
* @example App\Services\AirportLookup\VaCentralLookup
*
* @param string $icao
*
* @return Airport|null
*/
abstract public function getAirport($icao);
}