Skip to content

Commit 5b0e4d7

Browse files
committed
Remove unnecessary empty usages
1 parent 38da196 commit 5b0e4d7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

AbstractBrowser.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ public function reload(): Crawler
531531
*/
532532
public function followRedirect(): Crawler
533533
{
534-
if (empty($this->redirect)) {
534+
if (!$this->redirect) {
535535
throw new LogicException('The request was not redirected.');
536536
}
537537

Cookie.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function __construct(
7171
$this->value = $value ?? '';
7272
$this->rawValue = rawurlencode($this->value);
7373
}
74-
$this->path = empty($path) ? '/' : $path;
74+
$this->path = $path ?: '/';
7575

7676
if (null !== $expires) {
7777
$timestampAsDateTime = \DateTimeImmutable::createFromFormat('U', $expires);

CookieJar.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function expire(string $name, ?string $path = '/', ?string $domain = null
7171
{
7272
$path ??= '/';
7373

74-
if (empty($domain)) {
74+
if (!$domain) {
7575
// an empty domain means any domain
7676
// this should never happen but it allows for a better BC
7777
$domains = array_keys($this->cookieJar);

0 commit comments

Comments
 (0)