Skip to content

eregDeprecated sniff picks up method names #1492

Open
@afilina

Description

Bug Description

The following sniffs pick up method names in addition to function names, causing an error where it shouldn't:

  • eregDeprecatedRemoved
  • eregiDeprecatedRemoved
  • ereg_replaceDeprecatedRemoved
  • eregi_replaceDeprecatedRemoved

Given the following reproduction Scenario

The issue happens when running this command:

phpcs -ps file.php --standard=PHPCompatibility --runtime-set testVersion 8.1

... over a file containing this code:

MyClass::eregi($value, $string);

I'd expect the following behaviour

No errors or warnings.

Instead this happened

PHPCompatibility.Extensions.RemovedExtensions.eregDeprecatedRemoved

Environment

Environment Answer
PHP version 8.2.3
PHP_CodeSniffer version 3.7.2
PHPCompatibility version 9.3.5
Install type Composer project

Tested Against develop branch?

  • I have verified the issue still exists in the develop branch of PHPCompatibility.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions