Analyzer of PHP code to search issues with deprecated functionality in newer interpreter versions.
Analyzer of PHP code to search issues with deprecated functionality in newer interpreter versions.
PhpDeprecationDetector - analyzer of PHP code to search usages of deprecated functionality in newer interpreter versions - deprecations detector. PhpDeprecationDetector detects:
It literally helps you find code that can fail after migration to newer PHP version.
chmod +x phpdd-x.x.x.phara. Local installation: use it from current folder:
./phpdd-x.x.x.phar -hb. Global installation: move it in to one of folders listed in your $PATH and run from any folder:
sudo mv phpdd-x.x.x.phar /usr/local/bin/phpdd
phpdd -hAnother way to install phpdd is via composer.
curl -sS https://getcomposer.org/installer | php./composer.phar global require wapmorgan/php-deprecation-detector dev-masterphpdd -hTo scan your files or folder launch phpdd and pass file or directory names.
…--target you can specify version of PHP to perform less checks. Available target versions: 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0. A larger version includes rules for checking from all previous.--exclude option you can exclude specific folders or files from analyze. For example, --exclude vendor will prevent checking third-party libraries.--skip-checks option you can exclude specific checks from analyze.--file-extensions option. By default, it uses php, phtml and php5.--output-file option to specify path to store the output file as specified on --output (json or junit).…Also, you can store analyze result in json format for automatic check. Pass --output-file=FILENAME to write result to FILENAME file or do not set to output to stdout.
Also, you can store analyze result in junit format for automatic check. Pass --output-file=FILENAME to write result to FILENAME file or do not set to output to stdout.
Format of json - dictionary with items:
Items description:
magic_quotes_runtime or preg_replace() (@preg_replace_e_modifier))preg_replace() (@preg_replace_e_modifier) or parse_str() (@parse_str_without_argument))Usage of "e" modifier in preg_replace is deprecated: "asdasdsd~ie" or Call to parse_str() without second argument is deprecated)docker run --rm --interactive --tty --volume $PWD:/app composer:2.2.4 sh
# and inside a container:
docker-php-ext-install bcmath
composer require macfja/phar-builder
echo phar.readonly=0 >> /usr/local/etc/php/php-cli.ini
composer run-script buildNo open issues yet, or sync has not completed.