devdrops/php-toolbox
A Docker image designed for PHP developers that care about code quality.
Available on Docker Hub at devdrops/php-toolbox. Also check the whole content description at the MicroBadger.
Features
| TOOL | RELEASE |
|---|---|
| PHP | PHP 8.0.12 (cli) (built: Oct 21 2021 15:24:13) ( NTS ) |
| Composer | Composer 2.1.10 2021-10-29 22:34:57 |
| phpunit/phpunit | PHPUnit 9.5.10 by Sebastian Bergmann and contributors. |
| squizlabs/php_codesniffer | PHP_CodeSniffer version 3.6.1 (stable) by Squiz (http://www.squiz.net) |
| friendsofphp/php-cs-fixer | PHP CS Fixer 3.2.1 Mountains by Fabien Potencier and Dariusz Ruminski |
| phpmd/phpmd | PHPMD 2.10.2 |
| behat/behat | behat 3.8.1 |
| phploc/phploc | phploc 7.0.2 by Sebastian Bergmann. |
| phpstan/phpstan | PHPStan - PHP Static Analysis Tool 0.12.25 |
| icanhazstring/composer-unused | 0.5.6 |
| vimeo/psalm | Psalm 4.11.2@6fba5eb554f9507b72932f9c75533d8af593688d |
Install
docker pull devdrops/php-toolboxBuild it!
First, clone this repo. Then, navigate to it's root source.
For development:
./developUsage
All tools can be acessed by executing:
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest CHOOSEN_BINARYWhere CHOOSEN_BINARY is the binary you're looking for
Examples
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.
PHP
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest php -vComposer
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest composer installPHPUnit
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest phpunit --versionPHP_CodeSniffer
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest phpcs --standard=PSR2 Abstract.phpPHP CS Fixer
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest php-cs-fixer fix Abstract.phpPHP Mess Detector
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest phpmd Abstract.php text codesizeBehat
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest behat --versionphploc
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest phploc --versionphpstan
docker run -ti --rm -v $(pwd):/code -w /code devdrops/php-toolbox:latest phpstan --version