Home

Awesome

Toolbox

Build Status Build Status

Helps to discover and install tools.

Use cases

Toolbox started its life as a simple script in the phpqa docker image. Its purpose was to install set of tools while building the docker image and it's still its main goal. It has been extracted as a separate project to make maintenance easier and enable new use cases.

Available tools

NameDescriptionPHP 8.1PHP 8.2PHP 8.3
behatHelps to test business expectations
boxFast, zero config application bundler with PHARs
box-3Fast, zero config application bundler with PHARs
churnDiscovers good candidates for refactoring
codeceptionCodeception is a BDD-styled PHP testing framework
composerDependency Manager for PHP
composer-bin-pluginComposer plugin to install bin vendors in isolated locations
composer-normalizeComposer plugin to normalize composer.json files
composer-require-checkerVerify that no unknown symbols are used in the sources of a package.
composer-require-checker-3Verify that no unknown symbols are used in the sources of a package.
composer-unusedShow unused packages by scanning your code
dephpendDetect flaws in your architecture
deprecation-detectorFinds usages of deprecated code
deptracEnforces dependency rules between software layers
diffFilterApplies QA tools to run on a single pull request
ecsSets up and runs coding standard checks
infectionAST based PHP Mutation Testing Framework
larastanPHPStan extension for Laravel
local-php-security-checkerChecks composer dependencies for known security vulnerabilities
parallel-lintChecks PHP file syntax
paratestParallel testing for PHPUnit
pdependStatic Analysis Tool
pestThe elegant PHP Testing Framework
phanStatic Analysis Tool
phivePHAR Installation and Verification Environment
php-coupling-detectorDetects code coupling issues
php-cs-fixerPHP Coding Standards Fixer
php-fuzzerA fuzzer for PHP, which can be used to find bugs in libraries by feeding them 'random' inputs
php-semver-checkerSuggests a next version according to semantic versioning
phpaChecks for weak assumptions
phparkitectHelps to put architectural constraints in a PHP code base
phpatEasy to use architecture testing tool
phpbenchPHP Benchmarking framework
phpcaFinds usage of non-built-in extensions
phpcbPHP Code Browser
phpcbfAutomatically corrects coding standard violations
phpcodesniffer-composer-installEasy installation of PHP_CodeSniffer coding standards (rulesets).
phpcova command-line frontend for the PHP_CodeCoverage library
phpcpdCopy/Paste Detector
phpcsDetects coding standard violations
phpcs-security-auditFinds vulnerabilities and weaknesses related to security in PHP code
phpddFinds usage of deprecated features
phpDocumentorDocumentation generator
phpinsightsAnalyses code quality, style, architecture and complexity
phplintLints php files in parallel
phplocA tool for quickly measuring the size of a PHP project
phpmdA tool for finding problems in PHP code
phpmetricsStatic Analysis Tool
phpmndHelps to detect magic numbers
phpspecSpecBDD Framework
phpstanStatic Analysis Tool
phpstan-banned-codePHPStan rules for detecting calls to specific functions you don't want in your project
phpstan-beberlei-assertPHPStan extension for beberlei/assert
phpstan-deprecation-rulesPHPStan rules for detecting deprecated code
phpstan-doctrineDoctrine extensions for PHPStan
phpstan-ergebnis-rulesAdditional rules for PHPstan
phpstan-exception-rulesPHPStan rules for checked and unchecked exceptions
phpstan-larastanSeparate installation of phpstan for larastan
phpstan-phpunitPHPUnit extensions and rules for PHPStan
phpstan-strict-rulesExtra strict and opinionated rules for PHPStan
phpstan-symfonySymfony extension for PHPStan
phpstan-webmozart-assertPHPStan extension for webmozart/assert
phpunitThe PHP testing framework
phpunit-10The PHP testing framework (10.x version)
phpunit-8The PHP testing framework (8.x version)
phpunit-9The PHP testing framework (9.x version)
pintOpinionated PHP code style fixer for Laravel
psalmFinds errors in PHP applications
psalm-plugin-doctrineStubs to let Psalm understand Doctrine better
psalm-plugin-phpunitPsalm plugin for PHPUnit
psalm-plugin-symfonyPsalm Plugin for Symfony
psecio-parseScans code for potential security-related issues
rectorTool for instant code upgrades and refactoring
roave-backward-compatibility-checkTool to compare two revisions of a class API to check for BC breaks
simple-phpunitProvides utilities to report legacy tests and usage of deprecated code
twig-cs-fixerAutomatically corrects twig files following the official coding standard rules
twig-lintStandalone cli twig 1.X linter
twig-linterStandalone cli twig 3.X linter
twigcsThe missing checkstyle for twig!
yaml-lintCompact command line utility for checking YAML file syntax

Removed tools

NameSummary
analyzeVisualizes metrics and source code
box-legacyLegacy version of box
composer-normalizeComposer plugin to normalize composer.json files
design-patternDetects design patterns
parallel-lintChecks PHP file syntax
php-formatterCustom coding standards fixer
phpcfFinds usage of deprecated features
phpdaGenerates dependency graphs
phpdoc-to-typehintAutomatically adds type hints and return types based on PHPDocs
phpstan-localheinz-rulesAdditional rules for PHPstan
phpunit-5The PHP testing framework (5.x version)
phpunit-7The PHP testing framework (7.x version)
security-checkerChecks composer dependencies for known security vulnerabilities
testabilityAnalyses and reports testability issues of a php codebase

Installation

Get the toolbox.phar from the latest release. The command below should do the job:

curl -Ls https://github.com/jakzal/toolbox/releases/latest/download/toolbox.phar -o toolbox && chmod +x toolbox

Usage

List available tools

./toolbox list-tools

Filter tools by tags

To exclude some tools from the listing multiple --exclude-tag options can be added. The --tag option can be used to filter tools by tags.

./toolbox list-tools --exclude-tag exclude-php:8.2 --exclude-tag foo --tag bar

Install tools

./toolbox install

Install tools in a custom directory

By default tools are installed in the /usr/local/bin directory. To perform an installation in another location, pass the --target-dir option to the install command. Also, to change the location composer packages are installed in, export the COMPOSER_HOME environment variable.

mkdir /tools
export COMPOSER_HOME=/tools/.composer
export PATH="/tools:$COMPOSER_HOME/vendor/bin:$PATH"
./toolbox install --target-dir /tools

The target dir can also be configured with the TOOLBOX_TARGET_DIR environment variable.

Dry run

To only see what commands would be executed, use the dry run mode:

./toolbox install --dry-run

Filter tools by tags

To exclude some tools from the installation multiple --exclude-tag options can be added. The --tag option can be used to filter tools by tags.

./toolbox install --exclude-tag exclude-php:8.2 --exclude-tag foo --tag bar

Test if installed tools are usable

./toolbox test

Dry run

To only see what commands would be executed, use the dry run mode:

./toolbox test --dry-run

Filter tools by tags

To exclude some tools from the generated test command multiple --exclude-tag options can be added. The --tag option can be used to filter tools by tags.

./toolbox test --exclude-tag exclude-php:8.2 --exclude-tag foo --tag bar

Tools definitions

By default the following files are used to load tool definitions:

Definitions can be loaded from customised files by passing the --tools option(s):

./toolbox list-tools --tools path/to/file1.json --tools path/to/file2.json

Tool definition location(s) can be also specified with the TOOLBOX_JSON environment variable:

TOOLBOX_JSON='path/to/file1.json,path/to/file2.json' ./toolbox list-tools

Tool tags

Tools can be tagged in order to enable grouping and filtering them.

The tags below have a special meaning:

Contributing

Please read the Contributing guide to learn about contributing to this project. Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.