Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<env name="QUEUE_CONNECTION" value="database"/>
<ini name="xdebug.mode" value="coverage"/>
<ini name="memory_limit" value="-1"/>
<ini name="zend.assertions" value="1"/>
</php>

<source restrictDeprecations="true"
Expand Down
8 changes: 5 additions & 3 deletions src/Session/MongoDbSessionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use MongoDB\BSON\UTCDateTime;
use MongoDB\Collection;

use function assert;
use function tap;
use function time;

Expand Down Expand Up @@ -56,9 +55,12 @@ public function read($sessionId): string|false
'typeMap' => ['root' => 'bson'],
],
);
assert($result instanceof Document);

return $result ? (string) $result->payload : false;
if ($result instanceof Document) {
return (string) $result->payload;
}

return false;
}

public function write($sessionId, $data): bool
Expand Down
Loading