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

[9.x] Apply same syntax of startsWith on endsWith #42169

Merged

Conversation

cesarkohl
Copy link
Contributor

Hey guys, this is my first time ever contributing to an oss project. I've been looking for the first project and recently have chosen Laravel :)

There are two related functions, startsWith() and endsWith(), with quite similar behavior. Despite that, the syntax on the conditional is a bit different.

This PR improves the endsWith() using the same syntax on the startsWith() conditional.

// Illuminate/Support/Str.php:902
if ((string) $needle !== '' && str_starts_with($haystack, $needle)) {

@cesarkohl cesarkohl changed the title Apply same syntax of startsWith on endsWith [9.x] Apply same syntax of startsWith on endsWith Apr 28, 2022
@taylorotwell taylorotwell merged commit 58432f1 into laravel:9.x Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants