Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5a78951

Browse files
GromNaNtonivega
andauthored
Replaced a too strict assertion in DatabaseSessionHandler that prevented to use the sessions at all with a more simple sanity check (#3366) (#3368)
Set zend.assertions=1 --------- Co-authored-by: Toni Vega <1808267+tonivega@users.noreply.github.com>
1 parent db71580 commit 5a78951

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

‎.github/workflows/build-ci-atlas.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ jobs:
9191
- name: "Run tests"
9292
run: |
9393
export MONGODB_URI="mongodb://127.0.0.1:27017/?directConnection=true"
94-
./vendor/bin/phpunit --coverage-clover coverage.xml --group atlas-search
94+
php -d zend.assertions=1 ./vendor/bin/phpunit --coverage-clover coverage.xml --group atlas-search

‎.github/workflows/build-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,4 @@ jobs:
118118
- name: "Run tests"
119119
run: |
120120
export MONGODB_URI="mongodb://127.0.0.1:27017/?replicaSet=rs"
121-
./vendor/bin/phpunit --coverage-clover coverage.xml --exclude-group atlas-search
121+
php -d zend.assertions=1 ./vendor/bin/phpunit --coverage-clover coverage.xml --exclude-group atlas-search

‎phpunit.xml.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
<env name="QUEUE_CONNECTION" value="database"/>
2424
<ini name="xdebug.mode" value="coverage"/>
2525
<ini name="memory_limit" value="-1"/>
26+
<!-- Evaluate assertions, requires running with "php -d zend.assertions=1 vendor/bin/phpunit" -->
27+
<!-- <ini name="zend.assertions=1" value="1" /> -->
2628
</php>
2729

2830
<source restrictDeprecations="true"

‎src/Session/MongoDbSessionHandler.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use MongoDB\BSON\UTCDateTime;
1818
use MongoDB\Collection;
1919

20-
use function assert;
2120
use function tap;
2221
use function time;
2322

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

61-
return $result ? (string) $result->payload : false;
59+
if ($result instanceof Document) {
60+
return (string) $result->payload;
61+
}
62+
63+
return false;
6264
}
6365

6466
public function write($sessionId, $data): bool

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /