Skip to content

Commit 60f6518

Browse files
gharlannicolas-grekas
authored andcommitted
optimize in_array calls
1 parent 67faa9c commit 60f6518

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

AbstractBrowser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ public function followRedirect(): Crawler
567567

568568
$request = $this->internalRequest;
569569

570-
if (\in_array($this->internalResponse->getStatusCode(), [301, 302, 303])) {
570+
if (\in_array($this->internalResponse->getStatusCode(), [301, 302, 303], true)) {
571571
$method = 'GET';
572572
$files = [];
573573
$content = null;

HttpBrowser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected function doRequest(object $request): Response
6464
*/
6565
private function getBodyAndExtraHeaders(Request $request, array $headers): array
6666
{
67-
if (\in_array($request->getMethod(), ['GET', 'HEAD']) && !isset($headers['content-type'])) {
67+
if (\in_array($request->getMethod(), ['GET', 'HEAD'], true) && !isset($headers['content-type'])) {
6868
return ['', []];
6969
}
7070

0 commit comments

Comments
 (0)