Skip to content

developernaren/trip-sorter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trip Sorter

Assumptions

It is not mentioned in the doc that the card will have departure and destination but I have assumed that and wrote the system.

Run all the commands from the root of the project

Execution

The example code is written at src/index.php.
In the example, I have added multiple flights, bus and train travels to generate the itinerary.
The result can be viewed running this file from terminal as
$ php src/index

To view it in the browser
$ php -S localhost:8888 src/index.php

Tests

Tests are written in tests/ folder. To run the tests. Run
$ ./vendor/bin/phpunit

Extending to add transportation types

We can implement interface Transportation to the new Transportation type that we add.
Currently there are 3 types of transportation.

  • Bus
  • Train
  • Flight

All of these implement the interface. To add a new mode of transportation, the added mode can implement the interface Transportation and it should work.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages