Skip to content

Commit 57d7b1f

Browse files
fmwwwtaylorotwell
authored andcommitted
remove unnecessary foreach from is() method (#24872)
1 parent 23f6279 commit 57d7b1f

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/Illuminate/Http/Request.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,7 @@ public function segments()
184184
*/
185185
public function is(...$patterns)
186186
{
187-
foreach ($patterns as $pattern) {
188-
if (Str::is($pattern, $this->decodedPath())) {
189-
return true;
190-
}
191-
}
192-
193-
return false;
187+
return Str::is($patterns, $this->decodedPath());
194188
}
195189

196190
/**

0 commit comments

Comments
 (0)