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] Add Ignore Case of Str::contains and Str::containsAll to Stringable contains and containsAll #44369

Merged
merged 2 commits into from
Sep 29, 2022
Merged

[9.x] Add Ignore Case of Str::contains and Str::containsAll to Stringable contains and containsAll #44369

merged 2 commits into from
Sep 29, 2022

Conversation

byt3sage
Copy link
Contributor

This PR is here to resolve a little gremlin I found when using Fluent Strings. I wanted to do ->contains() and I needed it to ignore case. It turns out this isn't possible with the Stringable class. I've added in the ability to pass a boolean to Stringable contains and containsAll like how Str contains and containsAll works. I've also updated the pre-existing tests to test that ignore case works.

This doesn't break any existing implementations of these functions because it is an optional parameter placed last.

Now I did think about adding this to whenContains and whenContainsAll - if you feel this would be of benefit also within this PR then let me know and I'll get that bashed in.

I'm aware this is my first PR to the framework, so any feedback would be greatly appreciated.

@byt3sage byt3sage changed the title Add Ignore Case of Str::contains and Str::containsAll to Stringable contains and containsAll [9.x] Add Ignore Case of Str::contains and Str::containsAll to Stringable contains and containsAll Sep 29, 2022
@taylorotwell taylorotwell merged commit f7a5cfc into laravel:9.x Sep 29, 2022
@byt3sage byt3sage deleted the feature/add-case-sensitivity-to-fluent-string-contains branch February 25, 2023 11:50
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.

2 participants