File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -168,22 +168,24 @@ public function camel()
168
168
* Determine if a given string contains a given substring.
169
169
*
170
170
* @param string|iterable<string> $needles
171
+ * @param bool $ignoreCase
171
172
* @return bool
172
173
*/
173
- public function contains ($ needles )
174
+ public function contains ($ needles, $ ignoreCase = false )
174
175
{
175
- return Str::contains ($ this ->value , $ needles );
176
+ return Str::contains ($ this ->value , $ needles, $ ignoreCase );
176
177
}
177
178
178
179
/**
179
180
* Determine if a given string contains all array values.
180
181
*
181
182
* @param iterable<string> $needles
183
+ * @param bool $ignoreCase
182
184
* @return bool
183
185
*/
184
- public function containsAll ($ needles )
186
+ public function containsAll ($ needles, $ ignoreCase = false )
185
187
{
186
- return Str::containsAll ($ this ->value , $ needles );
188
+ return Str::containsAll ($ this ->value , $ needles, $ ignoreCase );
187
189
}
188
190
189
191
/**
Original file line number Diff line number Diff line change @@ -623,6 +623,7 @@ public function testContains()
623
623
$ this ->assertTrue ($ this ->stringable ('taylor ' )->contains (['ylo ' ]));
624
624
$ this ->assertTrue ($ this ->stringable ('taylor ' )->contains (['xxx ' , 'ylo ' ]));
625
625
$ this ->assertTrue ($ this ->stringable ('taylor ' )->contains (collect (['xxx ' , 'ylo ' ])));
626
+ $ this ->assertTrue ($ this ->stringable ('taylor ' )->contains (['LOR ' ], true ));
626
627
$ this ->assertFalse ($ this ->stringable ('taylor ' )->contains ('xxx ' ));
627
628
$ this ->assertFalse ($ this ->stringable ('taylor ' )->contains (['xxx ' ]));
628
629
$ this ->assertFalse ($ this ->stringable ('taylor ' )->contains ('' ));
@@ -631,6 +632,7 @@ public function testContains()
631
632
public function testContainsAll ()
632
633
{
633
634
$ this ->assertTrue ($ this ->stringable ('taylor otwell ' )->containsAll (['taylor ' , 'otwell ' ]));
635
+ $ this ->assertTrue ($ this ->stringable ('taylor otwell ' )->containsAll (['TAYLOR ' , 'OTWELL ' ], true ));
634
636
$ this ->assertTrue ($ this ->stringable ('taylor otwell ' )->containsAll (collect (['taylor ' , 'otwell ' ])));
635
637
$ this ->assertTrue ($ this ->stringable ('taylor otwell ' )->containsAll (['taylor ' ]));
636
638
$ this ->assertFalse ($ this ->stringable ('taylor otwell ' )->containsAll (['taylor ' , 'xxx ' ]));
You can’t perform that action at this time.
0 commit comments