Skip to content

Commit 29ae988

Browse files
authored
Cleanup: removed phpversion check (#4459)
* Cleanup: removed phpversion check * phpstan
1 parent d1d6358 commit 29ae988

File tree

2 files changed

+12
-25
lines changed

2 files changed

+12
-25
lines changed

.phpstan.dist.baseline.neon

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3066,12 +3066,6 @@ parameters:
30663066
count: 1
30673067
path: app/code/core/Mage/Core/Model/Config.php
30683068

3069-
-
3070-
message: '#^Comparison operation "\>\=" between int\<70400, 80499\> and 70300 is always true\.$#'
3071-
identifier: greaterOrEqual.alwaysTrue
3072-
count: 1
3073-
path: app/code/core/Mage/Core/Model/Cookie.php
3074-
30753069
-
30763070
message: '#^Binary operation "\+" between string and string results in an error\.$#'
30773071
identifier: binaryOp.invalid

app/code/core/Mage/Core/Model/Cookie.php

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -248,25 +248,18 @@ public function set($name, $value, $period = null, $path = null, $domain = null,
248248
$secure = true;
249249
}
250250

251-
if (PHP_VERSION_ID >= 70300) {
252-
setcookie(
253-
$name,
254-
(string) $value,
255-
[
256-
'expires' => $expire,
257-
'path' => $path,
258-
'domain' => $domain,
259-
'secure' => $secure,
260-
'httponly' => $httponly,
261-
'samesite' => $sameSite,
262-
],
263-
);
264-
} else {
265-
if (!empty($sameSite)) {
266-
$path .= "; samesite={$sameSite}";
267-
}
268-
setcookie($name, (string) $value, $expire, $path, $domain, $secure, $httponly);
269-
}
251+
setcookie(
252+
$name,
253+
(string) $value,
254+
[
255+
'expires' => $expire,
256+
'path' => $path,
257+
'domain' => $domain,
258+
'secure' => $secure,
259+
'httponly' => $httponly,
260+
'samesite' => $sameSite,
261+
],
262+
);
270263

271264
return $this;
272265
}

0 commit comments

Comments
 (0)