Skip to content

Commit 839c078

Browse files
Merge pull request #18619 from kamil-tekiela/setCookieParams
Remove unnecessary closure
2 parents 021580e + a77379c commit 839c078

2 files changed

Lines changed: 6 additions & 13 deletions

File tree

libraries/classes/Plugins/Auth/AuthenticationSignon.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,17 @@ public function setCookieParams(array|null $sessionCookieParams = null): void
6363
$sessionCookieParams = (array) $GLOBALS['cfg']['Server']['SignonCookieParams'];
6464
}
6565

66-
/* Sanitize cookie params */
67-
$defaultCookieParams = /** @return mixed */ static function (string $key) {
68-
return match ($key) {
69-
'lifetime' => 0,
70-
'path' => '/',
71-
'domain' => '',
72-
'secure', 'httponly' => false,
73-
default => null,
74-
};
75-
};
76-
7766
foreach (['lifetime', 'path', 'domain', 'secure', 'httponly'] as $key) {
7867
if (isset($sessionCookieParams[$key])) {
7968
continue;
8069
}
8170

82-
$sessionCookieParams[$key] = $defaultCookieParams($key);
71+
$sessionCookieParams[$key] = match ($key) {
72+
'lifetime' => 0,
73+
'path' => '/',
74+
'domain' => '',
75+
'secure', 'httponly' => false,
76+
};
8377
}
8478

8579
if (

psalm-baseline.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8110,7 +8110,6 @@
81108110
<code><![CDATA[$_SESSION['LAST_SIGNON_URL']]]></code>
81118111
<code>$hmacSecret</code>
81128112
<code>$pmaToken</code>
8113-
<code>$sessionCookieParams[$key]</code>
81148113
<code>$singleSignonCfgUpdate</code>
81158114
<code>$singleSignonHost</code>
81168115
<code>$singleSignonPort</code>

0 commit comments

Comments
 (0)