Skip to content

Commit

Permalink
refactor: remove unneeded if check
Browse files Browse the repository at this point in the history
Config\Cookie is now a must.
  • Loading branch information
kenjis committed Oct 23, 2023
1 parent def9351 commit 67f2b78
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions system/HTTP/ResponseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -581,14 +581,11 @@ public function setCookie(
return $this;
}

/** @var CookieConfig|null $cookieConfig */
$cookieConfig = config(CookieConfig::class);

if ($cookieConfig instanceof CookieConfig) {
$secure ??= $cookieConfig->secure;
$httponly ??= $cookieConfig->httponly;
$samesite ??= $cookieConfig->samesite;
}
$secure ??= $cookieConfig->secure;
$httponly ??= $cookieConfig->httponly;
$samesite ??= $cookieConfig->samesite;

if (is_array($name)) {
// always leave 'name' in last place, as the loop will break otherwise, due to ${$item}
Expand Down

0 comments on commit 67f2b78

Please sign in to comment.