Skip to content

Commit b839cef

Browse files
committed
[BrowserKit] Use strict comparison when possible
1 parent 115bad0 commit b839cef

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

AbstractBrowser.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function isFollowingRedirects(): bool
8787
public function setMaxRedirects(int $maxRedirects)
8888
{
8989
$this->maxRedirects = $maxRedirects < 0 ? -1 : $maxRedirects;
90-
$this->followRedirects = -1 != $this->maxRedirects;
90+
$this->followRedirects = -1 !== $this->maxRedirects;
9191
}
9292

9393
/**
@@ -354,7 +354,7 @@ public function request(string $method, string $uri, array $parameters = [], arr
354354
$server['HTTP_HOST'] = $this->extractHost($uri);
355355
}
356356

357-
$server['HTTPS'] = 'https' == parse_url($uri, \PHP_URL_SCHEME);
357+
$server['HTTPS'] = 'https' === parse_url($uri, \PHP_URL_SCHEME);
358358

359359
$this->internalRequest = new Request($uri, $method, $parameters, $files, $this->cookieJar->allValues($uri), $server, $content);
360360

@@ -623,7 +623,7 @@ protected function getAbsoluteUri(string $uri): string
623623
}
624624

625625
// anchor or query string parameters?
626-
if (!$uri || '#' == $uri[0] || '?' == $uri[0]) {
626+
if (!$uri || '#' === $uri[0] || '?' === $uri[0]) {
627627
return preg_replace('/[#?].*?$/', '', $currentUri).$uri;
628628
}
629629

@@ -654,7 +654,7 @@ private function updateServerFromUri(array $server, string $uri): array
654654
{
655655
$server['HTTP_HOST'] = $this->extractHost($uri);
656656
$scheme = parse_url($uri, \PHP_URL_SCHEME);
657-
$server['HTTPS'] = null === $scheme ? $server['HTTPS'] : 'https' == $scheme;
657+
$server['HTTPS'] = null === $scheme ? $server['HTTPS'] : 'https' === $scheme;
658658
unset($server['HTTP_IF_NONE_MATCH'], $server['HTTP_IF_MODIFIED_SINCE']);
659659

660660
return $server;

Cookie.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public static function fromString(string $cookie, string $url = null): static
157157

158158
if ('secure' === strtolower($part)) {
159159
// Ignore the secure flag if the original URI is not given or is not HTTPS
160-
if (!$url || !isset($urlParts['scheme']) || 'https' != $urlParts['scheme']) {
160+
if (!$url || !isset($urlParts['scheme']) || 'https' !== $urlParts['scheme']) {
161161
continue;
162162
}
163163

CookieJar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public function allValues(string $uri, bool $returnsRawValue = false): array
180180
}
181181

182182
foreach ($namedCookies as $cookie) {
183-
if ($cookie->isSecure() && 'https' != $parts['scheme']) {
183+
if ($cookie->isSecure() && 'https' !== $parts['scheme']) {
184184
continue;
185185
}
186186

History.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function add(Request $request)
4545
*/
4646
public function isEmpty(): bool
4747
{
48-
return 0 == \count($this->stack);
48+
return 0 === \count($this->stack);
4949
}
5050

5151
/**
@@ -83,7 +83,7 @@ public function forward(): Request
8383
*/
8484
public function current(): Request
8585
{
86-
if (-1 == $this->position) {
86+
if (-1 === $this->position) {
8787
throw new \LogicException('The page history is empty.');
8888
}
8989

0 commit comments

Comments
 (0)