File tree 2 files changed +5
-8
lines changed
2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ final class ContextStamp implements StampInterface
27
27
28
28
public function __construct (array $ context = [])
29
29
{
30
- if (($ request = ($ context ['request ' ] ?? null )) && $ request instanceof Request && $ request ->hasSession ()) {
30
+ /* Symfony does not guarantee that the Request object is serializable */
31
+ if (($ request = ($ context ['request ' ] ?? null )) && $ request instanceof Request) {
31
32
unset($ context ['request ' ]);
32
33
}
33
34
Original file line number Diff line number Diff line change @@ -34,15 +34,11 @@ public function testGetContext(): void
34
34
$ this ->assertIsArray ($ contextStamp ->getContext ());
35
35
}
36
36
37
- /**
38
- * @doesNotPerformAssertions
39
- */
40
- public function testSerializable (): void
37
+ public function testRequestIsUnset (): void
41
38
{
42
39
$ request = new Request ();
43
- $ request ->setSessionFactory (function (): void {}); // @phpstan-ignore-line
44
-
45
40
$ stamp = new ContextStamp (['request ' => $ request ]);
46
- serialize ($ stamp );
41
+
42
+ self ::assertArrayNotHasKey ('request ' , $ stamp ->getContext ());
47
43
}
48
44
}
You can’t perform that action at this time.
0 commit comments