- In order to run the code in this repository you must have PHP and Composer installed on your system or in a docker container.
- The minimum required version of PHP is 7.4.
- Clone the repository and open a terminal window at the root of this project and execute this command
composer dump-autoload
. To generate autoload files. - Next you will need to provide your boardings data as json array in a json file readable by PHP process user.
- To execute the program run
php src/index.php path-to-your-input-file.json
at the root of the project. - Or you can just run this
php src/index.php
to use the provided sample data.
- The time complexity in Big O Notation for the solution is O(n).
- In order to add more transportations, all you have to do is to create a new class at under the
Hamedov\PassSorter\Transportations
namespace with the same name as the type of transportation. For example if the new type iscar
the class should be namedCar
and must extend the abstract Transportation class and implement thegetInstructions() method
.
- There could be also some unit tests and better documentation to the code.
- We can also add more Sorting techniques instead of the default one.