Skip to content

Commit 22a21b8

Browse files
minor #53073 Set strict parameter of in_array to true where possible (alexandre-daubois)
This PR was merged into the 7.1 branch. Discussion ---------- Set `strict` parameter of `in_array` to true where possible | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT This pull request introduces a comprehensive update where the `in_array` function is now consistently invoked with the `strict` parameter set to `true`. This change is implemented across various components of the framework to enhance type safety and reliability. To me, this update is a step towards more explicit and error-resistant code. Commits ------- 442329a50f Set `strict` parameter of `in_array` to true where possible
2 parents 5748975 + 134f25e commit 22a21b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CurlHttpClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,11 +532,11 @@ private function validateExtraCurlOptions(array $options): void
532532
throw new InvalidArgumentException(sprintf('Cannot set "%s" with "extra.curl", use option "%s" instead.', $constName, $curloptsToConfig[$opt]));
533533
}
534534

535-
if (\in_array($opt, $methodOpts)) {
535+
if (\in_array($opt, $methodOpts, true)) {
536536
throw new InvalidArgumentException('The HTTP method cannot be overridden using "extra.curl".');
537537
}
538538

539-
if (\in_array($opt, $curloptsToCheck)) {
539+
if (\in_array($opt, $curloptsToCheck, true)) {
540540
$constName = $this->findConstantName($opt) ?? $opt;
541541
throw new InvalidArgumentException(sprintf('Cannot set "%s" with "extra.curl".', $constName));
542542
}

0 commit comments

Comments
 (0)