Refactor string checks to use str_starts_with and str_contains functions#438
Refactor string checks to use str_starts_with and str_contains functions#438dkotter merged 3 commits intoWordPress:developfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #438 +/- ##
==========================================
Coverage 68.44% 68.44%
Complexity 846 846
==========================================
Files 56 56
Lines 4095 4095
==========================================
Hits 2803 2803
Misses 1292 1292
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dkotter
left a comment
There was a problem hiding this comment.
So PHPStan is failing here as it can't find these functions. I think because they don't exist in PHP 7.4, though they are safe for us to use as WordPress polyfills these. Ideally we'll need to find a way to make PHPStan happy here before merging
Done in 5789bf7 |
What?
This pull request updates several string handling operations to use more modern and readable PHP string functions. The changes improve code clarity and maintainability by replacing older
strpospatterns withstr_starts_withandstr_contains.Changelog Entry