Please review src/refactor-me.php which contains code that desperately needs improving. There are a number of bugs and design flaws in it that need addressing.
The task is to refactor this code so that it is functional and also much improved from its current state. Feel free to refactor as much as you like and to use a framework if you prefer. We want you to consider how the code can be improved; is it maintainable, how can it be made to adhere to best practice
Note, to do well in this test you will need to refactor the code into multiple files. We would anticipate that a good submission should take no longer than a couple of hours.
To complete the exercise, please fork this repository and work directly in your fork. Once you've finished create a Pull Request back to this repository so we can view the diff.
We have included a docker setup to allow you to get up and running quickly with this example, though you are under no obligation to use this. After you have installed docker and forked the repository you will need to:
- Run
docker-compose up
- Import the sample sql file to the database
- Visit http://localhost:8080 in your browser