Skip to content

Commit 6f5ee01

Browse files
Revert "PHPStan, getName() never returns null so it can be removed from the return type."
This reverts commit 283f575.
1 parent 2bd4471 commit 6f5ee01

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/PhpSessionHandler.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,9 @@ public function start(): void
2626
/**
2727
* {@inheritDoc}
2828
*/
29-
public function getName(): string|null
29+
public function getName(): ?string
3030
{
31-
$sessionName = session_name();
32-
if ($sessionName === false) {
33-
$sessionName = null;
34-
}
35-
36-
return $sessionName;
31+
return (string)session_name();
3732
}
3833

3934
/**

src/SessionHandlerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function start(): void;
2626
*
2727
* @return string|null The name
2828
*/
29-
public function getName(): string|null;
29+
public function getName(): ?string;
3030

3131
/**
3232
* Get cookie params.

0 commit comments

Comments
 (0)