A sandbox to develop PHP projects.
To build the docker environment, install the dependencies (composer install) and login in the app container:
make docker-start docker-login
Now, you can open your browser at the app homepage (tcp port 8000):
The project includes vscode .devcontainer folder to automatize the build and develop or debug inside the docker container.
The project includes a Makefile to quickly execute some main tasks.
make
Usage:
make <target>
backup Backup codebase (*_YYYYMMDD_HHMM.tar.gz)
check Check codebase
clear Clear cache
docker-login Environment login
docker-start Environment start (docker-compose up)
docker-stop Environment stop (docker-compose down)
install Install packages (composer install)
server-start Start server
server-stop Stop server
test Test codebase (phpunit)
update Update packages (composer update)
You can also use the bash script ./git-hook.sh
to manage the .git/hooks/pre-commit
.
./git-hook.sh
Usage: git-hooks.sh [COMMAND]
Commands:
install Install .git/hooks/precommit
uninstall Uninstall .git/hooks/pre-commit
run Run ./scripts/git-hooks/pre-commit.sh
./git-hooks.sh run
Coding Standard
✔ PHP CS Fixer
✔ PHP Mess Detector
Static Analysis
✔ Psalm
✔ PHPArkitect
Test Execution
✔ PHPUnit
You can change ./scripts/git-hooks/pre-commit.sh
to customize it with your preferences.
vi ./scripts/git-hooks/pre-commit.sh
This sandbox includes the following packages:
Name | Package |
---|---|
PHPUnit | phpunit/phpunit |
PHP CS Fixer | friendsofphp/php-cs-fixer |
PHPStan | phpstan/phpstan |
PHPMD | phpmd/phpmd |
Psalm | vimeo/psalm |
PHPArkitect | phparkitect/phparkitect |