Page MenuHomeDevCentral

Publish phan wrapper
Closed, ResolvedPublic

Description

Phan is a static analysis tool for PHP.

To be able to run phan command, we can add a wrapper like this to call it from Composer bin directory:

phan
#!/bin/sh

if [ -f vendor/bin/phan ]; then
    vendor/bin/phan "$@"
    exit $?
fi

echo "Phan isn't installed on this repository. To install it:"
if [ -f composer.json ]; then
    echo "composer require phan/phan --dev"
else
    echo "composer init"
fi

We could start the detection at repo root instead from current folder.