- Install Phan in your project using Composer, it should create the script
vendor/bin/phan
, otherwise install it the way you want and hack therun-phan
script. - Install script
run-phan
(see at the bottom of this page) on your system (I decided to put it at/usr/local/bin/run-phan
). - In PHPStorm, go in Settings > Tools > External Tools, add a new tool and provide the parameters:
- Program:
/usr/local/bin/run-phan
- Working directory:
$ProjectFileDir$
- Check "Open console for tool output"
- Output filters:
$FILE_PATH$:$LINE$
- Program:
- You can now use it from Tools > External Tools > Phan (or assign it a shortcut)
Last active
September 16, 2020 08:42
-
-
Save patrickallaert/6a4ab48ad925d29fa6a02ab83ffb52e7 to your computer and use it in GitHub Desktop.
Integrate Phan in PHPStom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
php -n -d zend_extension=opcache -d extension=ast vendor/bin/phan --color --no-progress-bar | sed -E 's|(\x1b\[[0-9;]*m)([a-zA-Z0-9\-_\./]+\x1b\[[0-9;]*m:\x1b\[[0-9;]*m[[:digit:]]+\x1b\[[0-9;]*m)|\1'"$(pwd)"'/\2|g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment