You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An installation of PHP8 and Phan in a super tiny Alpine Linux
Docker image. The image is just 33 MB and runs interactively on the files
outside your container, making it easy to statically analyze PHP code.
Phan requires PHP7.2+ and specific PHP extensions to be installed.
These docker images use either php 8 or php 7.
By packaging Phan inside a Docker image, we can separate the runtime and
configuration of the tool from your application’s environment and requirements.
Getting phan/docker
The easiest way to use phan/docker is to create a shell function for “phan”
that makes makes it nearly transparent that phan is running inside Docker.
All of Phan’s command line flags can be passed to phan/docker.
Example
To create an “analysis.txt” in the current directory for further processing
phan -po analysis.txt
To run phan on a project that already has a .phan/config.php set up (assuming no symlinks)
cd /path/to/project
# short for: docker run -v $PWD:/mnt/src --rm -u "$(id -u):$(id -g)" phanphp/phan:latest
phan
Building
Docker images are built with the build script based on the awesome building
and testing framework put into place by the docker-alpine
contributors. See BUILD.md for more information.
Phan reports that classes from a PHP module are missing
Configuring Stubs
This aims to be a minimal docker image, and does not include many common PHP modules(extensions).