Skip to content

Commit

Permalink
Merge pull request #155 from jrfnl/feature/more-deprecated-functions
Browse files Browse the repository at this point in the history
Add two more deprecated function(s).
  • Loading branch information
wimg committed Aug 13, 2016
2 parents f65dc3d + 66d1e37 commit 69c0c57
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sniffs/PHP/DeprecatedFunctionsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class PHPCompatibility_Sniffs_PHP_DeprecatedFunctionsSniff extends PHPCompatibil
* @var array(string => array(string => bool|string|null))
*/
protected $forbiddenFunctions = array(
'php_check_syntax' => array(
'5.0.5' => true,
'alternative' => null
),
'call_user_method' => array(
'5.3' => false,
'5.4' => false,
Expand Down Expand Up @@ -626,6 +630,10 @@ class PHPCompatibility_Sniffs_PHP_DeprecatedFunctionsSniff extends PHPCompatibil
'5.6' => false,
'alternative' => 'OCI-Lob::writeTemporary'
),
'mysqli_get_cache_stats' => array(
'5.4' => true,
'alternative' => null
),
);

/**
Expand Down
2 changes: 2 additions & 0 deletions Tests/Sniffs/PHP/DeprecatedFunctionsSniffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ public function dataForbiddenFunction()
array('imagepsloadfont', '7.0', array(94), '5.6'),
array('imagepsslantfont', '7.0', array(95), '5.6'),
array('imagepstext', '7.0', array(96), '5.6'),
array('php_check_syntax', '5.0.5', array(98), '5.0', '5.1'),
array('mysqli_get_cache_stats', '5.4', array(99), '5.3'),

);
}
Expand Down
2 changes: 2 additions & 0 deletions Tests/sniff-examples/deprecated_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,5 @@
imagepsslantfont();
imagepstext();
ldap_sort();
php_check_syntax();
mysqli_get_cache_stats();

0 comments on commit 69c0c57

Please sign in to comment.