Skip to content

Commit

Permalink
Generic/DeprecatedFunctions: remove redundant method_exists()
Browse files Browse the repository at this point in the history
This code snippet was introduced in ec29df4 to allow for running the sniff on HHVM, but HHVM support has been dropped in PHPCS 3.3.1.

In native PHP, the `ReflectionFunctionAbstract::isDeprecated()` method is available since PHP 5.2, so this check is redundant.

Ref: https://www.php.net/manual/en/reflectionfunctionabstract.isdeprecated.php
  • Loading branch information
jrfnl committed Feb 17, 2020
1 parent 6070b60 commit b0ea915
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ public function __construct()

foreach ($functions['internal'] as $functionName) {
$function = new \ReflectionFunction($functionName);
if (method_exists($function, 'isDeprecated') === false) {
break;
}

if ($function->isDeprecated() === true) {
$this->forbiddenFunctions[$functionName] = null;
Expand Down

0 comments on commit b0ea915

Please sign in to comment.