Skip to content

Commit 9bec41d

Browse files
author
Stanislav Idolov
authored
ENGCOM-1186: [ForwardPort 2.3-develop] Remove else statements from \Magento\Framework\Session\SessionManager #14453
2 parents 2172994 + 33719b6 commit 9bec41d

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

lib/internal/Magento/Framework/Session/SessionManager.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,8 @@ public function setName($name)
317317
*/
318318
public function destroy(array $options = null)
319319
{
320-
if (null === $options) {
321-
$options = $this->defaultDestroyOptions;
322-
} else {
323-
$options = array_merge($this->defaultDestroyOptions, $options);
324-
}
320+
$options = $options ?? [];
321+
$options = array_merge($this->defaultDestroyOptions, $options);
325322

326323
if ($options['clear_storage']) {
327324
$this->clearStorage();
@@ -504,11 +501,7 @@ public function regenerateId()
504501
return $this;
505502
}
506503

507-
if ($this->isSessionExists()) {
508-
session_regenerate_id(true);
509-
} else {
510-
session_start();
511-
}
504+
$this->isSessionExists() ? session_regenerate_id(true) : session_start();
512505
$this->storage->init(isset($_SESSION) ? $_SESSION : []);
513506

514507
if ($this->sessionConfig->getUseCookies()) {

0 commit comments

Comments
 (0)