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
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 are written in tests/
folder. To run the tests. Run
$ ./vendor/bin/phpunit
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.