Add abstract class for route finding mechanism
This commit is contained in:
24
app/Contracts/RouteFinder.php
Normal file
24
app/Contracts/RouteFinder.php
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Contracts;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Abstract class for finding a route from a departure airport to an arrival airport
|
||||||
|
* Can allow for multiple, configurable methods for finding a route, whether it reaches
|
||||||
|
* out to a REST API or implement some sort of internal logic to look through a file
|
||||||
|
* or whatever the logic might be.
|
||||||
|
*
|
||||||
|
* Just one public-facing method needs to be implemented
|
||||||
|
*/
|
||||||
|
abstract class RouteFinder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Find a route from the departure ICAO to the arrival ICAO
|
||||||
|
*
|
||||||
|
* @param $dptIcao
|
||||||
|
* @param $arrIcao
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
abstract public function findRoute($dptIcao, $arrIcao): string;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user