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 === 0 to use str_starts_with #2262

Open
spacedmonkey opened this issue Jun 22, 2023 · 2 comments
Open

Add a lint for strpos === 0 to use str_starts_with #2262

spacedmonkey opened this issue Jun 22, 2023 · 2 comments

Comments

@spacedmonkey
Copy link
Member

Is your feature request related to a problem?

Describe the solution you'd like

Add a lint for strpos === 0 to use str_starts_with and the opposite. See hhttps://core.trac.wordpress.org/changeset/55703. str_starts_with is a php 8.0 function but a polyfill was added in core in WP 5.9. WordPress/wordpress-develop@1046682

Additional context (optional)

@spacedmonkey
Copy link
Member Author

Related #2261 .

@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