Skip to content

Commit

Permalink
optimize use in_array function
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere authored Apr 21, 2020
1 parent c9a8300 commit b23d273
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/http-message/src/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Swoft\Stdlib\Helper\ObjectHelper;
use function bean;
use function gmdate;
use function in_array;
use function urlencode;

/**
Expand Down Expand Up @@ -335,7 +336,7 @@ public function getSameSite(): string
*/
public function setSameSite(string $sameSite): Cookie
{
if (in_array($sameSite, static::SAME_SITE_VALUES)) {
if (in_array($sameSite, static::SAME_SITE_VALUES, true)) {
$this->sameSite = $sameSite;
} else {
$this->sameSite = '';
Expand Down

0 comments on commit b23d273

Please sign in to comment.