Docker image providing static analysis tools for PHP.
- composer - Dependency Manager for PHP
- box - An application for building and managing Phars
- analyze - Visualizes metrics and source code
- churn - Discovers good candidates for refactoring
- dephpend - Detect flaws in your architecture
- deprecation-detector - Finds usages of deprecated code
- deptrac - Enforces dependency rules
- design-pattern - Detects design patterns
- ecs - EasyCodingStandard sets up and runs coding standard checks with 0-knowledge of PHP-CS-Fixer and PHP_CodeSniffer
- parallel-lint - Checks PHP file syntax
- pdepend - Static Analysis Tool
- phan - Static Analysis Tool
- php-coupling-detector - Detects code coupling issues
- php-cs-fixer - PHP Coding Standards Fixer
- php-formatter - Custom coding standards fixer
- php-semver-checker - Suggests a next version according to semantic versioning
- phpDocumentor - Documentation generator
- phpa - Checks for weak assumptions
- phpca - Finds usage of non-built-in extensions
- phpcb - PHP Code Browser
- phpcbf - Automatically corrects coding standard violations
- phpcf - Finds usage of deprecated features
- phpcov - a command-line frontend for the PHP_CodeCoverage library
- phpcpd - Copy/Paste Detector
- phpcs - Detects coding standard violations
- phpda - Generates dependency graphs
- phpdoc-to-typehint - Automatically adds type hints and return types based on PHPDocs
- phploc - A tool for quickly measuring the size of a PHP project
- phpmd - A tool for finding problems in PHP code
- phpmetrics - Static Analysis Tool
- phpmnd - Helps to detect magic numbers
- phpstan - Static Analysis Tool
- psalm - Finds errors in PHP applications
- security-checker - Checks composer dependencies for known security vulnerabilities
- testability - Analyses and reports testability issues of a php codebase
Pull the image:
docker pull jakzal/phpqa
The default command will list available tools:
docker run -it --rm jakzal/phpqa
To run the selected tool inside the container, you'll need to mount the project directory on the container:
docker run -it --rm -v $(pwd):/project -w /project jakzal/phpqa phpstan analyse src
You'll probably want to tweak this command for your needs and create an alias for convenience:
alias phpqa="docker run -it --rm -v $(pwd):/project -w /project jakzal/phpqa:alpine"
Add it to your ~/.bashrc
so it's defined every time you start a new terminal session.
Now the command becomes a lot simpler:
phpqa phpstan analyse src
git clone https://github.com/jakzal/phpqa.git
cd phpqa
make build
To build the alpine version:
make build-alpine
It's often needed to customise the image with project specific extensions.
To achieve that simply create a new image based on jakzal/phpqa
:
FROM jakzal/phpqa:alpine
RUN apk add --no-cache libxml2-dev \
&& docker-php-ext-install soap
Next, build it:
docker build -t foo/phpqa .
Finally, use your customised image instead of the default one:
docker run -it --rm -v $(pwd):/project -w /project foo/phpqa phpmetrics .
The php-dbg debugger is provided by default. No additional extensions (like XDebug) are required to calculate code coverage:
phpqa phpdbg -qrr ./vendor/bin/phpunit --coverage-text
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.