-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Use str_ends_with() and str_starts_with() #44482
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
Use str_ends_with() and str_starts_with() #44482
Conversation
@@ -102,15 +102,15 @@ public function testEncodingAndDecodingSamples() | |||
$dir = realpath(__DIR__.'/../Fixtures/samples/charsets'); | |||
$sampleFp = opendir($dir); | |||
while (false !== $encoding = readdir($sampleFp)) { | |||
if ('.' == substr($encoding, 0, 1)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why the equality test ignored the type of the variables (no ===
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All updated packages require symfony/polyfill-php80
, except symfony/framework: 4.4
, can you add the dependency please.
Thanks for your review. I'm sorry but
If this is not the right file, please tell me the path of the file, because this PR didn't changed any file in the Framework namespace and I don't know what is the relevant file. |
My bad. That's the workflow component that needs this update. Sorry for the confusion. |
@alexislefebvre I am very sorry but @nicolas-grekas warned me that such changes are not made on the lowest maintained branch anymore (4.4) to avoid as many possible regressions as possible. The policy has changed recently and I did not know about it. It was not the case yet for #41576, that's why this one was made on 4.4. However it does not mean your work is lost, you just have to rebase it on 6.1, I guess most occurrences should still be there :-) @nicolas-grekas Can you confirm it plz? :-) |
I do confirm yes, we decided to be stricter now and merge only true bug fixes on lower branches. |
09f3ed6
to
04dfb0d
Compare
Thanks for your feedbacks. Psalm is trying to merge this PR in 4.4 and it fails. I opened a new PR: #44499 |
This PR was squashed before being merged into the 6.1 branch. Discussion ---------- Use str_ends_with() and str_starts_with() | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | no | License | MIT | Doc PR | no Use `str_ends_with()` and `str_starts_with()` instead of `substr()`. (replaces #44482 and #44476 🥲) Commits ------- 28d4d6b Use str_ends_with() and str_starts_with()
Use
str_ends_with()
andstr_starts_with()
instead ofsubstr()
.(replaces #44476)