A Docker image designed for PHP developers that care about code quality.
Available on Docker Hub at devdrops/php-toolbox.
From now on, I'll publish an image for every minor version of PHP, where latest
will be the most stable release at the moment:
- 7.4
- 8.0
- 8.1
- 8.2
Check each directory for more information regarding each version π
docker pull devdrops/php-toolbox
First, clone this repo. Then, navigate to it's root source.
For development:
./develop
All tools can be accessed by executing:
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest CHOOSEN_BINARY
Where CHOOSEN_BINARY
is the binary you're looking for π
You can run this image from whenever the folder you wish. But, just to give a few examples, consider the following structure for instance:
. βββ my-project βββ Abstract.php βββ bootstrap.php βββ composer.json βββ vendor
All the commands below will be executed from the project's root folder, my-project
.
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest php -v
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest composer install
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest phpunit --version
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest phpcs --standard=PSR2 Abstract.php
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest php-cs-fixer fix Abstract.php
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest phpmd Abstract.php text codesize
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest behat --version
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest phploc --version
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest phpstan --version