Calculator project use form, validation and solid principles.
- php 7.4
- symfony 5
- docker
- mysql
- twig for front side
This project require docker and docker-compose In root of project (check you have permission)
git clone https://github.com/kevin-schmitt/calculator.git
cd calculator
docker-compose up -d
make install
make test
Just choice operation (add, mult, div, sub) and calc
File structure
src/
Controller
CalculatorController # with POst method for calcul and receive total
Calculator # logic code
CalculatorHandler # entry for calcul with parameters from http request receive in controller
CalculatorService # execute calcul with parameters
Model
CalculatorDTO # model for calculator app
templates/
Calculator/
index.html.twig # form
tests/
Functional
CalculatorTest
- Add multiple operation (use session with last total calculated)
- refactor english name operation by symfony (add -> +, divide -> /)
- Use functional test with panther, currently need to resolve problem for run it inside of container
- Add unit tests
- Add log
- Add authentification