PhpDeprecationDetector
2.0.33: 8.2 fix and 8.0 rules change
PHPDEPRECATIONDETECTOR- 새로운 통역 버전 - 감가 상각 수 감지기에서 사용되지 않은 기능의 사용법을 검색하기위한 PHP 코드 분석기.
phpdeprecationDetector는 다음을 감지합니다.
문자 그대로 최신 PHP 버전으로 마이그레이션 한 후에 실패 할 수있는 코드를 찾는 데 도움이됩니다.
chmod +x phpdd-x.x.x.phar에이. 로컬 설치 : 현재 폴더에서 사용하십시오.
. /phpdd-x.x.x.phar -h 비. 글로벌 설치 : $PATH 에 나열된 폴더 중 하나로 이동하여 모든 폴더에서 실행하십시오.
sudo mv phpdd-x.x.x.phar /usr/local/bin/phpdd
phpdd -hPHPDD를 설치하는 또 다른 방법은 Composer를 통해입니다.
curl -sS https://getcomposer.org/installer | php./composer.phar global require wapmorgan/php-deprecation-detector dev-masterphpdd -h 파일 또는 폴더를 스캔하려면 phpdd 시작하고 파일 또는 디렉토리 이름을 전달합니다.
Description:
Analyzes PHP code and searches issues with deprecated functionality in newer interpreter versions.
Usage:
scan [options] [--] <files>...
Arguments:
files Which files you want to analyze (separate multiple names with a space)?
Options:
-t, --target[=TARGET] Sets target PHP interpreter version. [default: "8.0"]
-a, --after[=AFTER] Sets initial PHP interpreter version for checks. [default: "5.3"]
-e, --exclude[=EXCLUDE] Sets excluded file or directory names for scanning. If need to pass few names, join it with comma.
-s, --max-size[=MAX-SIZE] Sets max size of php file. If file is larger, it will be skipped. [default: "1mb"]
--file-extensions[=FILE-EXTENSIONS] Sets file extensions to be parsed. [default: "php, php5, phtml"]
--skip-checks[=SKIP-CHECKS] Skip all checks containing any of the given values. Pass a comma-separated list for multiple values.
--output[=OUTPUT] The output type required. Options: stdout, json, junit. Defaults to stdout.
--output-file[=OUTPUT-FILE] File path to store results where output is not stdout.
-h, --help Display help for the given command. When no command is given display help for the scan command
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
--target 된 PHP 버전을 지정하여 수표를 적게 수행 할 수 있습니다. 사용 가능한 대상 버전 : 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0. 더 큰 버전에는 이전의 모든 확인 규칙이 포함됩니다.--exclude 옵션을 제공하면 분석에서 특정 폴더 또는 파일을 제외 할 수 있습니다. 예를 들어, --exclude vendor 타사 라이브러리 확인을 방지합니다.--skip-checks 옵션을 제공하면 Analyze에서 특정 검사를 제외 할 수 있습니다.--file-extensions 옵션으로 모든 내장을 지정할 수 있습니다. 기본적으로 php , phtml 및 php5 사용합니다.--output-file 옵션을 사용하여 --output (json 또는 junit)에 지정된 출력 파일을 저장하는 경로를 지정하십시오. > ./bin/phpdd tests/
Max file size set to: 1.000 MiB
Folder /media/wapmorgan/Локальный диск/Документы/PhpDeprecationDetector/tests
- PHP 5.3 (3) - your version is greater or equal
+------------+---------+---------------------------------------------------------------------+
| File:Line | Type | Issue |
+------------+---------+---------------------------------------------------------------------+
| /5.3.php:2 | removed | Function dl() is removed. |
| /5.3.php:3 | removed | Ini define_syslog_variables is removed. |
| /5.3.php:5 | changed | Function usage piet() (@call_with_passing_by_reference) is changed. |
| | | Call with passing by reference is deprecated. Problem is "&$hoho" |
+------------+---------+---------------------------------------------------------------------+
- PHP 5.4 (2) - your version is greater or equal
+------------+---------+-----------------------------------------------+
| File:Line | Type | Issue |
+------------+---------+-----------------------------------------------+
| /5.4.php:2 | removed | Function mcrypt_generic_end() is removed. |
| | | Consider replace with mcrypt_generic_deinit() |
| /5.4.php:3 | removed | Function magic_quotes_runtime() is removed. |
+------------+---------+-----------------------------------------------+
...
...
...
또한 자동 점검을 위해 JSON 형식의 분석 결과를 저장할 수 있습니다. Pass- --output-file=FILENAME Filename 파일에 결과를 쓸거나 stdout 으로 출력으로 설정되지 않습니다.
또한 자동 점검을위한 Junit 형식에 분석 결과를 저장할 수 있습니다. Pass- --output-file=FILENAME Filename 파일에 결과를 쓸거나 stdout 으로 출력으로 설정되지 않습니다.
JSON 형식 - 항목과 함께 사전 :
항목 설명 :
magic_quotes_runtime 또는 preg_replace() (@preg_replace_e_modifier) )preg_replace() (@preg_replace_e_modifier) 또는 parse_str() (@parse_str_without_argument) )Usage of "e" modifier in preg_replace is deprecated: "asdasdsd~ie" 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 build