- Configure your
env.local
DATABASE_NAME=api
DATABASE_USER=root
DATABASE_PASSWORD=root
DATABASE_ROOT_PASSWORD=root
DATABASE_URL=mysql://${DATABASE_USER}:${DATABASE_PASSWORD}@database:3306/${DATABASE_NAME}?serverVersion=mariadb-10.4.21
// Start the docker instance
docker-compose up -d
// Run the composer install
docker-compose run php-fpm composer install
// create the database tables
docker-compose run php-fpm bin/console doctrine:migration:migrate
flowchart LR
A[Request] --> B{Controller}
B -->|POST| C[RequestHandler]
B -->|GET| D[Service]
B -->|PATCH| C[RequestHandler]
B -->|PUT| C[RequestHandler]
B -->|DELETE| D[Service]
C -->|Serializer| E[Repository]
D -->|onSuccess| E[Repository]
Deptrac is a static code analysis tool for PHP that helps you communicate, visualize and enforce architectural decisions in your projects. You can freely define your architectural layers over classes and which rules should apply to them.
docker-compose run php-fpm ./vendor/bin/deptrac
Psalm is a static analysis tool for finding errors in PHP applications.
docker-compose run php-fpm ./vendor/bin/psalm
The PHP Coding Standards Fixer (PHP CS Fixer) tool fixes your code to follow standards
docker-compose run php-fpm ./vendor/bin/phpcs ./src
docker-compose run php-fpm bin/console --env=test doctrine:database:create
docker-compose run php-fpm bin/console --env=test doctrine:schema:create
docker-compose run php-fpm bin/phpunit