Skip to content

ezebemmel/training

Repository files navigation

PHP Scaffolding

MIT Software License

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 your docker-compose.yml
  • Basic structure ready to start coding in src and tests

Setup

curl -sS https://raw.githubusercontent.com/Chemaclass/php-scaffolding/master/setup.sh > setup.sh
bash setup.sh YourNewProjectName
rm setup.sh

Getting the bash from your project

docker exec -ti -u dev your_project_name bash

Some composer scripts

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

Git hooks

  • ./tools/scripts/git-hooks/pre-commit.sh
  • ./tools/scripts/git-hooks/pre-push.sh

Installation

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

Contributions

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published