This is a scaffolding for PHP projects using Docker.
In this repository you will find:
PHP
(7.4)Composer
(currently 2.0)PHPUnit
(currently 9)XDebug
(currently 3)Psalm
(currently 4)- A basic
Dockerfile
ready to use from yourdocker-compose.yml
- Basic structure ready to start coding in
src
andtests
curl -sS https://raw.githubusercontent.com/Chemaclass/php-scaffolding/master/setup.sh > setup.sh
bash setup.sh YourNewProjectName
rm setup.sh
docker exec -ti -u dev your_project_name bash
composer test-all # run test-quality & test-unit
composer test-quality # run csrun & psalm
composer test-unit # run phpunit
composer csrun # check code style
composer psalm # run Psalm coverage
./tools/scripts/git-hooks/pre-commit.sh
./tools/scripts/git-hooks/pre-push.sh
ln -s tools/scripts/git-hooks/pre-commit.sh .git/hooks/pre-commit
ln -s tools/scripts/git-hooks/pre-push.sh .git/hooks/pre-push
Installing this repository locally
docker-compose up -d
docker-compose exec php_scaffolding composer install
docker-compose exec -u dev php_scaffolding composer test-all
docker exec -ti -u dev php_scaffolding bash
Feel free to open any PR with your ideas, suggestions or improvements.
Or contact me directly via Twitter.