Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eregDeprecated sniff picks up method names #1492

Open
1 task
afilina opened this issue Apr 13, 2023 · 2 comments
Open
1 task

eregDeprecated sniff picks up method names #1492

afilina opened this issue Apr 13, 2023 · 2 comments
Milestone

Comments

@afilina
Copy link
Contributor

afilina commented Apr 13, 2023

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.
@jrfnl jrfnl added this to the 10.0.0 milestone Apr 13, 2023
@jrfnl
Copy link
Member

jrfnl commented Apr 13, 2023

@afilina This is a known issue and the RemovedExtensions sniff is slated to be removed before the PHPCompatibility 10.0.0 release because of it.

See #1022 for further details.

@jrfnl jrfnl closed this as completed Apr 13, 2023
@jrfnl jrfnl reopened this Apr 13, 2023
@jrfnl
Copy link
Member

jrfnl commented Apr 13, 2023

(sorry, will leave this issue open until #1022 has been finalized)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants