Skip to content

Instantly share code, notes, and snippets.

@bueltge
Last active Jun 29, 2021
Embed
What would you like to do?
Static PHP7 analyses with Phan and PHP 7 Migration Assistant Report (MAR), PHP 5 to PHP7 Migration Tools

Phan

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

Install via Composer

composer require --dev phan/phan

note: php-ast is necessary (sudo apt install php-ast)

Help

./vendor/bin/phan -h

Usage

./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 Migration Assistant Report (MAR)

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

Install via Composer

composer require --dev alexia/php7mar

Help

php ./vendor/alexia/php7mar/mar.php

Usage

php ./vendor/alexia/php7mar/mar.php -f="<path>/<file.php>"

@bueltge

This comment has been minimized.

Copy link
Owner Author

@bueltge bueltge commented Jan 25, 2020

Also, helpful to migrate php 5 code base to php 7*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment