Boarding Challenge
The problem
You are given a stack of boarding cards for various transportations that will take you from a point A to point B via several stops on the way. All of the boarding cards are out of order and you don't know where your journey starts, nor where it ends. Each boarding card contains information about seat assignment, and means of transportation (such as flight number, bus number etc).
Assumptions:
departure
andarrival
data are provided by an external DTO.
The API is responsible only for sorting and printing found routes.- The API throws an internal PHP exception (RuntimeException) for simplicity.
- The API does not use PHP docblock regarding to the PHP version (> 7.0) and type hinting.
- The boarding cards are unique. Cards can be filter in the step before the API.
Installation
- Make sure you're using PHP 7.1 or higher and have composer installed
- Clone repository: git clone https://github.com/c3zi/boarding-challenge
- Install all dependencies using composer:
composer install
Usage
To run an example just execute: php app.php
Quality
To run unit tests execute: ./vendor/bin/phpunit tests