Static PHP7 analyses with phan and
Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness. github.com/phan/phan
composer require --dev phan/phan
note: php-ast is necessary (sudo apt install php-ast
)
./vendor/bin/phan -h
./vendor/bin/phan -b <path>/<file.php>
cd <directory>
find . -name '*.php' | grep -v test > filelist.txt
./vendor/bin/phan -i -b -f filelist.txt
PHP 7 MAR, or just "php7mar", is a command line utility to generate reports on existing PHP 5 code to assist developers in porting their code quickly to PHP 7. github.com/Alexia/php7mar
composer require --dev Alexia/php7mar
php ./vendor/alexia/php7mar/mar.php
php ./vendor/alexia/php7mar/mar.php -f="<path>/<file.php>"