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

Add a lint for strpos !== false to use str_contains #2261

Open
spacedmonkey opened this issue Jun 22, 2023 · 1 comment
Open

Add a lint for strpos !== false to use str_contains #2261

spacedmonkey opened this issue Jun 22, 2023 · 1 comment

Comments

@spacedmonkey
Copy link
Member

Is your feature request related to a problem?

Describe the solution you'd like

Add a lint for strpos !== false to use ! str_contains and the opposite. See WordPress/wordpress-develop@9e9887d. str_contains is a php 8.0 function but a polyfill was added in core in WP 5.9. WordPress/wordpress-develop@3cc8f12

Additional context (optional)

@jrfnl
Copy link
Member

jrfnl commented Jun 23, 2023

Note: This type of sniff should be created in the Modernize standard in PHPCSExtra and then used by WPCS.

@jrfnl jrfnl removed this from the 3.x Next milestone Jun 23, 2023
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

3 participants