Skip to content

PhpCodeFixer finds usage of deprecated functions, variables and ini directives in your php code.

License

Notifications You must be signed in to change notification settings

kuwa72/PhpCodeFixer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhpCodeFixer

composer package Latest Stable Version Total Downloads License

PhpCodeFixer finds usage of deprecated functions, variables and ini directives in your php code.

Example of usage

To scan your files or folder launch phpcf and pass file or directory names.

> php bin\phpcf tests
Scanning tests ...
[5.3] Function dl is deprecated in file tests/5.3.php[2].
[5.3] Ini setting define_syslog_variables is deprecated in file tests/5.3.php[3].
[5.4] Function mcrypt_generic_end is deprecated in file tests/5.4.php[2].
[5.5] Function preg_replace usage is deprecated (@preg_replace_e_modifier) in file tests/5.5.php[2].
[5.6] Ini setting mbstring.http_output is deprecated in file tests/5.6.php[6]. Consider using default_charset instead.
[5.6] Variable $HTTP_RAW_POST_DATA is deprecated in file tests/5.6.php[3].

By providing additional parameter --target you can specify version of PHP to perform less checks.

Option Action
--target 7.1 Use all deprecations from 5.3 to 7.1.
--target 7.0 Use all deprecations from 5.3 to 7.0.
--target 5.6 Use all deprecations from 5.3 to 5.6.
--target 5.5 Use all deprecations from 5.3 to 5.5.
--target 5.4 Use all deprecations from 5.3 to 5.4.
--target 5.3 Use deprecations from 5.3 only.

Installation

Composer

The recommended way to install phpcf is via composer.

  1. If you do not have composer installed, download the composer.phar executable or use the installer.
$ curl -sS https://getcomposer.org/installer | php
  1. Run php composer.phar require wapmorgan/php-code-fixer or add requirement in composer.json.
{
  "require": {
    "wapmorgan/php-code-fixer": "*"
  }
}
  1. Run php composer.phar update

About

PhpCodeFixer finds usage of deprecated functions, variables and ini directives in your php code.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%